From: Luca Bruno Date: Sun, 9 Jun 2013 19:22:46 +0000 (+0200) Subject: Allow symbol_from_string to return null X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=788d65f51960cefa3cef7afcdd8131070bbfbf7a;p=thirdparty%2Fvala.git Allow symbol_from_string to return null --- diff --git a/vala/valacodebuilder.vala b/vala/valacodebuilder.vala index 45f4da490..e2087c7fc 100644 --- a/vala/valacodebuilder.vala +++ b/vala/valacodebuilder.vala @@ -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;