Skip to content

Commit 508bcc7

Browse files
committed
Making the python dictionary existence check more robust
1 parent 161fa27 commit 508bcc7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

driver/run.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,19 @@ def prepare_scan(cmdline):
213213
configuration = json.load(config_file)
214214
file_name = os.path.basename(config_file.name)
215215

216-
if not configuration["detectedEntryPointsPath"]:
216+
if not configuration.get("detectedEntryPointsPath", None):
217217
configuration["detectedEntryPointsPath"] = \
218218
os.path.join(cmdline.common_dir, "detected_entry_points.json")
219219

220-
if not configuration["diConfigurationPath"]:
220+
if not configuration.get("diConfigurationPath", None):
221221
configuration["diConfigurationPath"] = \
222222
os.path.join(cmdline.common_dir, "di_configuration.json")
223223

224-
if not configuration["collectedClassesPath"]:
224+
if not configuration.get("collectedClassesPath", None):
225225
configuration["collectedClassesPath"] = \
226226
os.path.join(cmdline.common_dir, "collected_classes.json")
227227

228-
if not configuration["collectedClassesInfoPath"]:
228+
if not configuration.get("collectedClassesInfoPath", None):
229229
configuration["collectedClassesInfoPath"] = \
230230
os.path.join(cmdline.common_dir, "collected_classes_info.json")
231231

0 commit comments

Comments
 (0)