From f15eaec254efadc12091dfd45af09629a72f9a49 Mon Sep 17 00:00:00 2001 From: Daan Hoogland Date: Thu, 16 Jul 2015 16:51:02 +0200 Subject: [PATCH] coverity 1116759: possible null-pointer before indexOf-call move the if-block inside the next, guarded one Signed-off-by: Daan Hoogland This closes #600 --- .../framework/serializer/OnwireClassRegistry.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 77269f3a21e..872e49c2af5 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