From: Ray Strode Date: Mon, 14 Jul 2014 12:04:54 +0000 (-0400) Subject: seat: be a little more forgiving in the case there's no open terminal X-Git-Tag: 0.9.2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84eb4381db85877a9a56b35994e6c10d43e46ebe;p=thirdparty%2Fplymouth.git seat: be a little more forgiving in the case there's no open terminal We can end up in a situation where a seat object doesn't have a terminal associated with it. In that case we shouldn't crash, but continue on with no input available for that seat. https://bugs.freedesktop.org/show_bug.cgi?id=80553 --- diff --git a/src/libply-splash-core/ply-seat.c b/src/libply-splash-core/ply-seat.c index 9cc689d3..700332fc 100644 --- a/src/libply-splash-core/ply-seat.c +++ b/src/libply-splash-core/ply-seat.c @@ -144,13 +144,22 @@ ply_seat_open (ply_seat_t *seat, if (seat->renderer != NULL) { seat->keyboard = ply_keyboard_new_for_renderer (seat->renderer); add_pixel_displays (seat); - } else { + } else if (seat->terminal != NULL) { seat->keyboard = ply_keyboard_new_for_terminal (seat->terminal); } - add_text_displays (seat); - ply_keyboard_watch_for_input (seat->keyboard); - seat->keyboard_active = true; + if (seat->terminal != NULL) { + add_text_displays (seat); + } else { + ply_trace ("not adding text display for seat, since seat has no associated terminal"); + } + + if (seat->keyboard != NULL) { + ply_keyboard_watch_for_input (seat->keyboard); + seat->keyboard_active = true; + } else { + ply_trace ("not watching seat for input"); + } return true; }