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



commit ded0a196de4850ab15fd421399950a94462c5f93
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 98003f3e..da91ae34 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 (datamap.reverse_lookup (kbd_layout) != null) {


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