[vala/wip/transform: 73/103] Allow symbol_from_string to return null
- From: Rico Tzschichholz <ricotz src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [vala/wip/transform: 73/103] Allow symbol_from_string to return null
 
- Date: Sat,  3 Nov 2018 19:09:55 +0000 (UTC)
 
commit 34704975eef8bec0a625e4dfd4fe4b4c9f35231b
Author: Luca Bruno <lucabru src gnome org>
Date:   Sun Jun 9 21:22:46 2013 +0200
    Allow symbol_from_string to return null
 vala/valacodebuilder.vala | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
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;
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]