]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Allow symbol_from_string to return null
authorLuca Bruno <lucabru@src.gnome.org>
Sun, 9 Jun 2013 19:22:46 +0000 (21:22 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 11 Mar 2019 12:52:38 +0000 (13:52 +0100)
vala/valacodebuilder.vala

index 45f4da490bfdf4f5fc8e99516a22d5796e50b8da..e2087c7fcad077f2a2af7cfd9339d6e3f210f5d8 100644 (file)
@@ -265,9 +265,12 @@ public class Vala.CodeBuilder {
        }
 
        // only qualified types, will slightly simplify the work of SymbolResolver
-       public static Symbol symbol_from_string (string symbol_string, Symbol? parent_symbol = null) {
+       public static Symbol? symbol_from_string (string symbol_string, Symbol? parent_symbol = null) {
                Symbol sym = parent_symbol != null ? parent_symbol : CodeContext.get().root;
                foreach (unowned string s in symbol_string.split (".")) {
+                       if (sym == null) {
+                               break;
+                       }
                        sym = sym.scope.lookup (s);
                }
                return sym;