commit | 94328fdf8cbcbdda55c6f7ccd64f238bdaf7422b | [log] [tgz] |
---|---|---|
author | Felix Meschberger <fmeschbe@apache.org> | Tue Feb 23 08:53:55 2010 +0000 |
committer | Felix Meschberger <fmeschbe@apache.org> | Tue Feb 23 08:53:55 2010 +0000 |
tree | 865321865280c78b49186dde07a5f27fc29404ce | |
parent | 97e4f09d9a8d16f44f7239e9c537ef82a95702c8 [diff] |
FELIX-2122 Prevent NullPointerException if NoClassDefFoundError does not provide a message git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@915246 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java index 3061693..570694a 100644 --- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java +++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
@@ -294,7 +294,12 @@ catch ( NoClassDefFoundError ncdfe ) { String message = ncdfe.getMessage(); - if ( message.indexOf( ' ' ) < 0 ) + if ( message == null ) + { + // no message, construct it + message = "Class definition not found (NoClassDefFoundError)"; + } + else if ( message.indexOf( ' ' ) < 0 ) { // message is just a class name, try to be more descriptive message = "Class " + message + " missing";