default to an empty dict for the from service if the service is None

Signed-off-by: Natanael Arndt <arndtn@gmail.com>
This commit is contained in:
Natanael Arndt 2023-07-26 15:30:31 +02:00 committed by Muayyad Alsadi
parent 280f1770bf
commit e5cdce4e7d

View File

@ -1375,7 +1375,11 @@ def resolve_extends(services, service_names, environ):
content = content["services"]
subdirectory = os.path.dirname(filename)
content = rec_subs(content, environ)
from_service = content.get(from_service_name, {})
from_service = (
{}
if content.get(from_service_name, {}) is None
else content.get(from_service_name, {})
)
normalize_service(from_service, subdirectory)
else:
from_service = services.get(from_service_name, {}).copy()