This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-factory-deploymentpackage.git
commit 138b79de5fac1992858518c480e58293e37f9ac3 Author: Carsten Ziegeler <[email protected]> AuthorDate: Tue Jan 18 09:50:01 2011 +0000 Fix NPEs and make service execution more robust. git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1060274 13f79535-47bb-0310-9956-ffa450edef68 --- .../deploypck/impl/DeploymentPackageInstaller.java | 41 +++++++++++----------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/main/java/org/apache/sling/installer/factories/deploypck/impl/DeploymentPackageInstaller.java b/src/main/java/org/apache/sling/installer/factories/deploypck/impl/DeploymentPackageInstaller.java index fa0337f..934b18f 100644 --- a/src/main/java/org/apache/sling/installer/factories/deploypck/impl/DeploymentPackageInstaller.java +++ b/src/main/java/org/apache/sling/installer/factories/deploypck/impl/DeploymentPackageInstaller.java @@ -91,29 +91,30 @@ public class DeploymentPackageInstaller private Manifest getManifest(final InputStream ins) throws IOException { Manifest result = null; - JarInputStream jis = null; - try { - jis = new JarInputStream(ins); - result= jis.getManifest(); - - } finally { - - // close the jar stream or the inputstream, if the jar - // stream is set, we don't need to close the input stream - // since closing the jar stream closes the input stream - if (jis != null) { - try { - jis.close(); - } catch (IOException ignore) { - } - } else { - try { - ins.close(); - } catch (IOException ignore) { + if ( ins != null ) { + JarInputStream jis = null; + try { + jis = new JarInputStream(ins); + result= jis.getManifest(); + + } finally { + + // close the jar stream or the inputstream, if the jar + // stream is set, we don't need to close the input stream + // since closing the jar stream closes the input stream + if (jis != null) { + try { + jis.close(); + } catch (IOException ignore) { + } + } else { + try { + ins.close(); + } catch (IOException ignore) { + } } } } - return result; } -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
