]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[script] Return NULL when requesting width of nonexistent window
authorCharlie Brej <cbrej@cs.man.ac.uk>
Mon, 22 Mar 2010 22:41:17 +0000 (22:41 +0000)
committerCharles Brej <cbrej@cs.man.ac.uk>
Mon, 22 Mar 2010 22:41:17 +0000 (22:41 +0000)
Minor bug, previously would return the index used rather than a NULL. Would
only cause problems when using a width request as a test of the presence of a
window.

src/plugins/splash/script/script-lib-sprite.c

index 8185d7d7b0a1bf95fae94657ecbc45ee87e8b113..c3923995fec433a469da33f817df511fe53c7b1c 100644 (file)
@@ -222,7 +222,7 @@ static script_return_t sprite_window_get_width (script_state_t *state,
 
   node = ply_list_get_nth_node (data->displays, index);
   if (node == NULL)
-    return script_return_obj (script_obj_new_number (index));
+    return script_return_obj_null ();
   display = ply_list_node_get_data (node);
   width = ply_pixel_display_get_width (display->pixel_display);
   return script_return_obj (script_obj_new_number (width));