diff --git a/decouple.py b/decouple.py index 9873fc9..86295fd 100644 --- a/decouple.py +++ b/decouple.py @@ -98,6 +98,12 @@ def get(self, option, default=undefined, cast=undefined): elif cast is bool: cast = self._cast_boolean + if value is None or value == '': + if not isinstance(default, Undefined): + value = default + else: + cast = self._cast_do_nothing + return cast(value) def __call__(self, *args, **kwargs):