]> granicus.if.org Git - icinga2/commitdiff
Don't throw an error when namespace indexers don't find a valid key 6669/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Thu, 11 Oct 2018 10:42:56 +0000 (12:42 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Thu, 11 Oct 2018 10:42:56 +0000 (12:42 +0200)
Examples:

```
globals["abc"]
globals.def
```

The patch for the Icinga Director unfortunately only solves the
master, and as discussed with @lippserd we need to ensure that
satellites and clients with 2.10 can be restarted without any errors
from deployed configuration.

refs #6509
refs icinga/icingaweb2-module-director#1654

lib/base/namespace.cpp

index d106a0ee3706c762645cd9587fcf7ac807bfdef2..909a765113e8f21313a47af6b1fea6786bb29167 100644 (file)
@@ -108,7 +108,7 @@ Value Namespace::GetFieldByName(const String& field, bool, const DebugInfo& debu
        if (nsVal)
                return nsVal->Get(debugInfo);
        else
-               return GetPrototypeField(const_cast<Namespace *>(this), field, true, debugInfo);
+               return GetPrototypeField(const_cast<Namespace *>(this), field, false, debugInfo); /* Ignore indexer not found errors similar to the Dictionary class. */
 }
 
 void Namespace::SetFieldByName(const String& field, const Value& value, bool overrideFrozen, const DebugInfo& debugInfo)