Merge pull request #6669 from Icinga/feature/no-errors-with-indexer-access-in-namespaces

Don't throw an error when namespace indexers don't find a valid key
This commit is contained in:
Michael Friedrich 2018-10-11 13:21:11 +02:00 committed by GitHub
commit a3cfa5fba4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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)