avoid crashing on undetected video thumbnail size (that can e.g. happen especially...
authorGuillaume Cottenceau <gcottenc@gmail.com>
Thu, 4 Nov 2010 22:53:20 +0000 (23:53 +0100)
committerGuillaume Cottenceau <gcottenc@gmail.com>
Thu, 4 Nov 2010 22:53:20 +0000 (23:53 +0100)
bin/booh-backend

index c81bb80..b44a2c1 100755 (executable)
@@ -1387,8 +1387,13 @@ def walk_source_dir
                             index = videos.index(file)
                             elements4js << '"' + fullscreen_videos[sizeobj['name']][index] + '"'
                             size = get_image_size("#{dest_dir}/#{fullscreen_videos[sizeobj['name']][index]}")
-                            videoswidths4js << size[:x].to_s
-                            videosheights4js << size[:y].to_s
+                            if size
+                                videoswidths4js << size[:x].to_s
+                                videosheights4js << size[:y].to_s
+                            else
+                                videoswidths4js << "''"
+                                videosheights4js << "''"
+                            end
                         end
                     end
                 end