File tree Expand file tree Collapse file tree
utils/src/com/cloud/utils/script Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -308,7 +308,7 @@ public static class Task implements Runnable {
308308 public Task (OutputInterpreter interpreter , BufferedReader reader ) {
309309 this .interpreter = interpreter ;
310310 this .reader = reader ;
311- this . result = null ;
311+ result = null ;
312312 }
313313
314314 @ Override
@@ -340,8 +340,6 @@ public synchronized String getResult() throws InterruptedException {
340340 public static String findScript (String path , String script ) {
341341 s_logger .debug ("Looking for " + script + " in the classpath" );
342342
343- path = path .replace ("/" , File .separator );
344-
345343 URL url = ClassLoader .getSystemResource (script );
346344 s_logger .debug ("System resource: " + url );
347345 File file = null ;
@@ -351,6 +349,12 @@ public static String findScript(String path, String script) {
351349 return file .getAbsolutePath ();
352350 }
353351
352+ if (path == null ) {
353+ s_logger .warn ("No search path specified, unable to look for " + script );
354+ return null ;
355+ }
356+ path = path .replace ("/" , File .separator );
357+
354358 /**
355359 * Look in WEB-INF/classes of the webapp
356360 * URI workaround the URL encoding of url.getFile
You can’t perform that action at this time.
0 commit comments