[gnome-boxes/fix-crash-when-input-source-not-available: 2/2] unnatended-installer: Fix crash when input-source is not available



commit 8c5468232fb521650ab1a33eea8331bc6aa08fb7
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
    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 2b5920b5..c1dfd89c 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -664,7 +664,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 (kbd_layout != null && datamap.reverse_lookup (kbd_layout) != null) {


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