From 5776804b4a9d2ca340a7e6a4c2cb8aac4869b286 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sun, 3 Mar 2013 13:48:54 -0500 Subject: [PATCH] IDEMPIERE-633 AdempiereActivator.packIn() causes NullPointerException --- .../src/org/adempiere/plugin/utils/AdempiereActivator.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/AdempiereActivator.java b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/AdempiereActivator.java index 70511dc342..bc861de6f9 100644 --- a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/AdempiereActivator.java +++ b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/AdempiereActivator.java @@ -11,6 +11,7 @@ import org.adempiere.base.IDictionaryService; import org.adempiere.base.Service; import org.compiere.model.Query; import org.compiere.model.X_AD_Package_Imp; +import org.compiere.util.AdempiereSystemError; import org.compiere.util.Env; import org.compiere.util.Trx; import org.osgi.framework.BundleActivator; @@ -97,6 +98,8 @@ public class AdempiereActivator implements BundleActivator { IDictionaryService service = Service.locator().locate(IDictionaryService.class).getService(); FileOutputStream zipstream = null; try { + if (service == null) + throw new AdempiereSystemError("Could not find/load OSGi service for packin"); // copy the resource to a temporary file to process it with 2pack InputStream stream = context.getBundle().getEntry("/META-INF/2Pack.zip").openStream(); File zipfile = File.createTempFile(getName(), ".zip");