]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[script] Only attach to the keyboard if it has been set
authorCharlie Brej <cbrej@cs.man.ac.uk>
Thu, 1 Apr 2010 16:26:58 +0000 (17:26 +0100)
committerCharlie Brej <cbrej@cs.man.ac.uk>
Thu, 1 Apr 2010 16:26:58 +0000 (17:26 +0100)
Don't add an input handler to a NULL keyboard.

src/plugins/splash/script/plugin.c

index e304fdfe8aacb41596a5305eaf069685254465f8..0174594777ae1f94d26720a479078180fa15a620 100644 (file)
@@ -224,9 +224,10 @@ start_script_animation (ply_boot_splash_plugin_t *plugin)
   script_return_t ret = script_execute (plugin->script_state,
                                         plugin->script_main_op);
   script_obj_unref (ret.object);
-  ply_keyboard_add_input_handler (plugin->keyboard,
-                                  (ply_keyboard_input_handler_t)
-                                  on_keyboard_input, plugin);
+  if (plugin->keyboard != NULL)
+    ply_keyboard_add_input_handler (plugin->keyboard,
+                                    (ply_keyboard_input_handler_t)
+                                    on_keyboard_input, plugin);
   on_timeout (plugin);
 
   return true;