coverity 1116759: possible null-pointer before indexOf-call move the if-block 
inside the next, guarded one

Signed-off-by: Daan Hoogland <[email protected]>

This closes #600


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f15eaec2
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f15eaec2
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f15eaec2

Branch: refs/heads/reporter
Commit: f15eaec254efadc12091dfd45af09629a72f9a49
Parents: 8849d50
Author: Daan Hoogland <[email protected]>
Authored: Thu Jul 16 16:51:02 2015 +0200
Committer: Daan Hoogland <[email protected]>
Committed: Fri Jul 17 13:12:26 2015 +0200

----------------------------------------------------------------------
 .../cloudstack/framework/serializer/OnwireClassRegistry.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f15eaec2/framework/ipc/src/org/apache/cloudstack/framework/serializer/OnwireClassRegistry.java
----------------------------------------------------------------------
diff --git 
a/framework/ipc/src/org/apache/cloudstack/framework/serializer/OnwireClassRegistry.java
 
b/framework/ipc/src/org/apache/cloudstack/framework/serializer/OnwireClassRegistry.java
index 77269f3..872e49c 100644
--- 
a/framework/ipc/src/org/apache/cloudstack/framework/serializer/OnwireClassRegistry.java
+++ 
b/framework/ipc/src/org/apache/cloudstack/framework/serializer/OnwireClassRegistry.java
@@ -106,10 +106,10 @@ public class OnwireClassRegistry {
             if (resources != null) {
                 while (resources.hasMoreElements()) {
                     String filePath = resources.nextElement().getFile();
-                    // WINDOWS HACK
-                    if (filePath.indexOf("%20") > 0)
-                        filePath = filePath.replaceAll("%20", " ");
                     if (filePath != null) {
+                        // WINDOWS HACK
+                        if (filePath.indexOf("%20") > 0)
+                            filePath = filePath.replaceAll("%20", " ");
                         if ((filePath.indexOf("!") > 0) && 
(filePath.indexOf(".jar") > 0)) {
                             String jarPath = filePath.substring(0, 
filePath.indexOf("!")).substring(filePath.indexOf(":") + 1);
                             // WINDOWS HACK

Reply via email to