Skip to content

Commit

Permalink
LPD-43352 Handle orphan references in content
Browse files Browse the repository at this point in the history
  • Loading branch information
adolfopa authored and nikki-pru committed Dec 9, 2024
1 parent b1499c7 commit 0615e45
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ private DLFileEntry _getDLFileEntry(long companyId, Matcher matcher)
_fileEntryFriendlyURLResolver.resolveFriendlyURL(
group.getGroupId(), friendlyURL);

if (fileEntry == null) {
return null;
}

return (DLFileEntry)fileEntry.getModel();
}

Expand Down Expand Up @@ -185,6 +189,14 @@ private long _getDLFileEntryId(long companyId, String src)
try {
DLFileEntry dlFileEntry = _getDLFileEntry(companyId, matcher);

if (dlFileEntry == null) {
if (_log.isWarnEnabled()) {
_log.warn("Missing file entry for URL " + src);
}

return 0;
}

return dlFileEntry.getFileEntryId();
}
catch (PortalException portalException) {
Expand Down

0 comments on commit 0615e45

Please sign in to comment.