You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by fm...@apache.org on 2008/01/15 13:29:32 UTC
svn commit: r612094 -
/incubator/sling/whiteboard/fmeschbe/resource/osgi/commons/src/main/java/org/apache/sling/osgi/commons/OsgiUtil.java
Author: fmeschbe
Date: Tue Jan 15 04:29:31 2008
New Revision: 612094
URL: http://svn.apache.org/viewvc?rev=612094&view=rev
Log:
Prevent NPE if the property value is null in toStringArray
Modified:
incubator/sling/whiteboard/fmeschbe/resource/osgi/commons/src/main/java/org/apache/sling/osgi/commons/OsgiUtil.java
Modified: incubator/sling/whiteboard/fmeschbe/resource/osgi/commons/src/main/java/org/apache/sling/osgi/commons/OsgiUtil.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/resource/osgi/commons/src/main/java/org/apache/sling/osgi/commons/OsgiUtil.java?rev=612094&r1=612093&r2=612094&view=diff
==============================================================================
--- incubator/sling/whiteboard/fmeschbe/resource/osgi/commons/src/main/java/org/apache/sling/osgi/commons/OsgiUtil.java (original)
+++ incubator/sling/whiteboard/fmeschbe/resource/osgi/commons/src/main/java/org/apache/sling/osgi/commons/OsgiUtil.java Tue Jan 15 04:29:31 2008
@@ -137,7 +137,11 @@
* returned.
*/
public static String[] toStringArray(Object propValue) {
- if (propValue instanceof String) {
+ if (propValue == null) {
+ // no value at all
+ return null;
+
+ } else if (propValue instanceof String) {
// single string
return new String[] { (String) propValue };