Handle NULL boot_buffer

boot_buffer may be NULL if plymouthd failed to attach to the console
session (e.g. if booting without an initramfs so /dev/pts isn't mounted
yet).  Handle this gracefully rather than segfaulting.
This commit is contained in:
Colin Watson 2010-04-28 13:31:39 +01:00 committed by Ray Strode
parent 7021306e43
commit c859e580a1

View file

@ -250,9 +250,12 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
detach_from_event_loop,
plugin);
size = ply_buffer_get_size (boot_buffer);
if (boot_buffer)
{
size = ply_buffer_get_size (boot_buffer);
write_on_views (plugin, ply_buffer_get_bytes (boot_buffer), size);
write_on_views (plugin, ply_buffer_get_bytes (boot_buffer), size);
}
return true;
}