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
This commit is contained in:
Daan Hoogland 2015-07-16 16:51:02 +02:00
parent 8849d506cb
commit f15eaec254

View File

@ -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