Fix a bug in the `Configuration` provider to correctly handle undefined values

This commit is contained in:
Roman Mogylatov 2021-01-15 16:21:57 -05:00
parent b873137614
commit d9ff0a01fd
2 changed files with 3235 additions and 3239 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1462,6 +1462,9 @@ cdef class Configuration(Object):
keys = selector.split('.') keys = selector.split('.')
value = self.__call__() value = self.__call__()
if value is None:
return None
while len(keys) > 0: while len(keys) > 0:
key = keys.pop(0) key = keys.pop(0)
value = value.get(key) value = value.get(key)
@ -1507,8 +1510,6 @@ cdef class Configuration(Object):
:return: Overriding context. :return: Overriding context.
:rtype: :py:class:`OverridingContext` :rtype: :py:class:`OverridingContext`
""" """
if provider is None:
provider = {}
context = super().override(provider) context = super().override(provider)
self.reset_cache() self.reset_cache()
return context return context