[gnome-boxes/handle-unavailable-input-sources-3-34] unnatended-installer: Fix crash when input-source is not available



commit f24352aae1f8fbdf1a77e941ce575969b7299f13
Author: Felipe Borges <felipeborges gnome org>
Date:   Fri Nov 15 09:35:35 2019 +0100

    unnatended-installer: Fix crash when input-source is not available
    
    Fixes #438

 src/unattended-installer.vala | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index cac78ed1..075c5778 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -685,7 +685,10 @@ private string get_preferred_keyboard (string lang) {
             var sources = input_settings.get_value ("sources");
 
             if (sources != null) {
-                kbd_layout = sources.get_child_value (0).get_child_value (1).get_string ();
+                var sources_pair = sources.get_child_value (0);
+                if (sources_pair != null) {
+                    kbd_layout = sources_pair.get_child_value (1).get_string ();
+                }
             }
 
             if (datamap.reverse_lookup (kbd_layout) != null) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]