Skip to content

Commit 389d7ec

Browse files
authored
Merge pull request #36 from fosslight/installed_bug
Add exception handling for cases where the 'installed' key is not present
2 parents 40c50a9 + 5aa1423 commit 389d7ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/fosslight_android/android_binary_analysis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def get_module_json_obj_by_installed_path(module_name, binary_name_with_path, bi
156156
else: # Find binary by installed path
157157
for key in module_info_json_obj:
158158
js_value = module_info_json_obj[key]
159-
output_files = js_value["installed"]
159+
output_files = js_value.get("installed",None)
160160
if output_files is not None:
161161
for output_file in output_files:
162162
if output_file == binary_name_with_path:
@@ -167,6 +167,7 @@ def get_module_json_obj_by_installed_path(module_name, binary_name_with_path, bi
167167
if path_with_out_dir == output_file:
168168
js_value[MODULE_TYPE_NAME] = key
169169
return js_value
170+
170171
return ""
171172

172173

0 commit comments

Comments
 (0)