diff --git a/modules/apps/dynamic-data-mapping/dynamic-data-mapping-service/src/main/java/com/liferay/dynamic/data/mapping/internal/upgrade/v5_6_1/DDMFieldAttributeUpgradeProcess.java b/modules/apps/dynamic-data-mapping/dynamic-data-mapping-service/src/main/java/com/liferay/dynamic/data/mapping/internal/upgrade/v5_6_1/DDMFieldAttributeUpgradeProcess.java index d803c4a7f96f96..d9d6f5f3a65318 100644 --- a/modules/apps/dynamic-data-mapping/dynamic-data-mapping-service/src/main/java/com/liferay/dynamic/data/mapping/internal/upgrade/v5_6_1/DDMFieldAttributeUpgradeProcess.java +++ b/modules/apps/dynamic-data-mapping/dynamic-data-mapping-service/src/main/java/com/liferay/dynamic/data/mapping/internal/upgrade/v5_6_1/DDMFieldAttributeUpgradeProcess.java @@ -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(); } @@ -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) {