diff --git a/assemblyline_ui/api/v4/result.py b/assemblyline_ui/api/v4/result.py index 4289e4dd..58061d96 100644 --- a/assemblyline_ui/api/v4/result.py +++ b/assemblyline_ui/api/v4/result.py @@ -153,8 +153,11 @@ def get_service_result(cache_key, **kwargs): if data is None: return make_api_response("", "Cache key %s does not exists." % cache_key, 404) - cur_file = STORAGE.file.get(cache_key[:64], as_obj=False) - data = format_result(user['classification'], data, cur_file['classification'], build_hierarchy=True) + cur_file = STORAGE.file.get(cache_key[:64], as_obj=False) or {} + data = format_result(user['classification'], + data, + cur_file.get('classification', CLASSIFICATION.UNRESTRICTED), + build_hierarchy=True) if not data: return make_api_response("", "You are not allowed to view the results for this key", 403)