Skip to content

Commit

Permalink
Merge pull request #427 from DigitalSlideArchive/guard-resource-paths
Browse files Browse the repository at this point in the history
Guard resource path lookups
  • Loading branch information
manthey authored Oct 17, 2024
2 parents 81aaa8f + a1abee9 commit 3f37985
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion histomicsui/rest/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import datetime
import os

from girder import logger
from girder.api import access
from girder.api.describe import Description, autoDescribeRoute, describeRoute
from girder.api.rest import RestException, boundHandler, filtermodel
Expand Down Expand Up @@ -458,5 +459,12 @@ def getMultipleResourcePaths(self, resources):
model = ModelImporter.model(kind)
for id in resources[kind]:
doc = model.load(id=id, user=user, level=AccessType.READ)
results[kind][id] = path_util.getResourcePath(kind, doc, user=user)
if doc is None:
logger.info(f'Failed to load {kind} {id}')
continue
try:
results[kind][id] = path_util.getResourcePath(kind, doc, user=user)
except Exception:
logger.info(f'Failed to resolve path for {kind} {id} {doc}')
continue
return results

0 comments on commit 3f37985

Please sign in to comment.