[gnome-boxes/unattended-installer-warnings: 1/2] unattended-installer: Fix access to possibly null value




commit c526fd7aa5aa183cfc98748985620db911828e0b
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue Apr 13 12:02:00 2021 +0200

    unattended-installer: Fix access to possibly null value

 src/unattended-installer.vala | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index d48db8b1..53114380 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -673,7 +673,9 @@ private string get_preferred_keyboard (string lang) {
             if (sources != null) {
                 var sources_pair = sources.get_child_value (0);
                 if (sources_pair != null) {
-                    kbd_layout = sources_pair.get_child_value (1).get_string ();
+                    var sources_pair_value = sources_pair.get_child_value (1);
+                    if (sources_pair_value != null)
+                        kbd_layout = sources_pair_value.get_string ();
                 }
             }
 


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