]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
fade-throbber,space-flares,two-step: Don't crash if no console viewer
authorRay Strode <rstrode@redhat.com>
Wed, 27 Dec 2023 19:50:09 +0000 (14:50 -0500)
committerRay Strode <rstrode@redhat.com>
Wed, 27 Dec 2023 19:50:09 +0000 (14:50 -0500)
The splash plugins don't create a console viewer if
`plymouth.prefer-fbcon` is on the kernel command line, but expect it
to be not NULL regardless.

This commit corrects that misconception.

src/plugins/splash/fade-throbber/plugin.c
src/plugins/splash/space-flares/plugin.c
src/plugins/splash/two-step/plugin.c

index 35b1444c9bec5c9840399ac86fbf785081ae13eb..1d0a6e8211f25b27004678d3e45ac49c0e766928 100644 (file)
@@ -135,6 +135,9 @@ view_show_prompt_on_console_viewer (view_t     *view,
 {
         ply_boot_splash_plugin_t *plugin = view->plugin;
 
+        if (view->console_viewer == NULL)
+                return;
+
         if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL)
                 ply_console_viewer_print (view->console_viewer, "\n");
 
index 1e984bac5384880de40f2dcdd748f7e682c92b92..9a4fb7e47d0d46f87197d0e524534d86843ba46e 100644 (file)
@@ -462,6 +462,9 @@ view_show_prompt_on_console_viewer (view_t     *view,
 {
         ply_boot_splash_plugin_t *plugin = view->plugin;
 
+        if (view->console_viewer == NULL)
+                return;
+
         if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL)
                 ply_console_viewer_print (view->console_viewer, "\n");
 
index 83a1a58ee33a5b60fa39f1a95ebae86c88558d57..c7c0f81cc432abb54b6325c5a60363ed905f96fa 100644 (file)
@@ -967,6 +967,9 @@ view_show_prompt_on_console_viewer (view_t     *view,
 {
         ply_boot_splash_plugin_t *plugin = view->plugin;
 
+        if (view->console_viewer == NULL)
+                return;
+
         if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL)
                 ply_console_viewer_print (view->console_viewer, "\n");