Skip to content

Commit f15eaec

Browse files
committed
coverity 1116759: possible null-pointer before indexOf-call move the if-block inside the next, guarded one
Signed-off-by: Daan Hoogland <daan@onecht.net> This closes #600
1 parent 8849d50 commit f15eaec

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

framework/ipc/src/org/apache/cloudstack/framework/serializer/OnwireClassRegistry.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ static Set<Class<?>> getClasses(ClassLoader loader, String packageName) {
106106
if (resources != null) {
107107
while (resources.hasMoreElements()) {
108108
String filePath = resources.nextElement().getFile();
109-
// WINDOWS HACK
110-
if (filePath.indexOf("%20") > 0)
111-
filePath = filePath.replaceAll("%20", " ");
112109
if (filePath != null) {
110+
// WINDOWS HACK
111+
if (filePath.indexOf("%20") > 0)
112+
filePath = filePath.replaceAll("%20", " ");
113113
if ((filePath.indexOf("!") > 0) && (filePath.indexOf(".jar") > 0)) {
114114
String jarPath = filePath.substring(0, filePath.indexOf("!")).substring(filePath.indexOf(":") + 1);
115115
// WINDOWS HACK

0 commit comments

Comments
 (0)