From e4441c83efc15515ce63c43cb943e656a44ad53c Mon Sep 17 00:00:00 2001 From: Gabriele Zigurella Date: Mon, 27 Feb 2023 12:47:57 +0100 Subject: [PATCH] fix: handle null FileEntry on riparaPermessiAsseverazioni method --- .../src/it/mwg/sismica/bo/util/SismicaUtil.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java index f27d71af..042d432b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java @@ -1458,7 +1458,7 @@ public class SismicaUtil { try { pratica = IntPraticaLocalServiceUtil.getIntPratica(documento.getIntPraticaId()); } catch (PortalException e) { - _log.error(e,e) + _log.error(e,e); } if (Validator.isNotNull(pratica) && (documento.getFileEntryId() != 0)) { Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(pratica.getTerritorioId()); @@ -1466,7 +1466,7 @@ public class SismicaUtil { try { fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId()); } catch (Exception e) { - _log.error(e,e) + _log.error(e,e); } if(Validator.isNotNull(fileEntry)){ corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " @@ -1508,10 +1508,14 @@ public class SismicaUtil { FileEntry fileEntry = null; try { fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId()); - } catch (Exception e) {} - corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " - + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento - + StringPool.SPACE + documento.getPrimaryKey()); + } catch (Exception e) { + _log.error(e,e); + } + if(Validator.isNotNull(fileEntry)){ + corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " + + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento + + StringPool.SPACE + documento.getPrimaryKey()); + } } } inizio += SLICE;