From 8f3fd01535cf6c6851975f64d91e112762c63cb0 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Sat, 11 Aug 2007 10:14:57 +0000 Subject: [PATCH] Bug 43006 - NPE if icon.properties file not found git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/branches/rel-2-2@564889 13f79535-47bb-0310-9956-ffa450edef68 --- src/core/org/apache/jmeter/util/JMeterUtils.java | 10 ++++++++-- xdocs/changes.xml | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/core/org/apache/jmeter/util/JMeterUtils.java b/src/core/org/apache/jmeter/util/JMeterUtils.java index 737db236af..1aa38a8f53 100644 --- a/src/core/org/apache/jmeter/util/JMeterUtils.java +++ b/src/core/org/apache/jmeter/util/JMeterUtils.java @@ -27,6 +27,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.net.URL; import java.util.Enumeration; import java.util.Hashtable; import java.util.Iterator; @@ -188,11 +189,16 @@ public class JMeterUtils implements UnitTestManager { p.load(is); } catch (IOException e) { try { - is = JMeterUtils.class.getClassLoader().getResource(file).openStream(); - if (is == null) { + final URL resource = JMeterUtils.class.getClassLoader().getResource(file); + if (resource == null) { log.warn("Cannot find " + file); return null; } + is = resource.openStream(); + if (is == null) { + log.warn("Cannot open " + file); + return null; + } p.load(is); } catch (IOException ex) { log.warn("Error reading " + file + " " + ex.toString()); diff --git a/xdocs/changes.xml b/xdocs/changes.xml index 2082220374..ed39475f70 100644 --- a/xdocs/changes.xml +++ b/xdocs/changes.xml @@ -36,6 +36,7 @@
  • Fixed errors when running non-GUI on a headless host
  • Bug 43054 - SSLManager causes stress tests to saturate and crash
  • Clarified HTTP Request Defaults usage of the port field
  • +
  • Bug 43006 - NPE if icon.properties file not found
  • Version 2.3RC3