Skip to content

Commit e0b65a0

Browse files
committed
Safely access media section
1 parent b7a09c1 commit e0b65a0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ctfcli/core/media.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ class Media:
66
@staticmethod
77
def replace_placeholders(content: str) -> str:
88
config = Config()
9-
for m in config["media"]:
9+
try:
10+
section = config["media"]
11+
except KeyError:
12+
section = []
13+
for m in section:
1014
content = safe_format(content, items={m: config["media"][m]})
1115
return content

0 commit comments

Comments
 (0)