--- a/tool/src/main/controller.java
+++ b/tool/src/main/controller.java
@@ -121,6 +121,10 @@
newRequest.scriptMethod = is.methodDefault;
}
+ // we need the base folder to be defined as well
+ newRequest.BaseFolder = newRequest.scriptFile.getParentFile();
+ newRequest.scriptFolder = newRequest.BaseFolder;
+
// do a unique id for this request
long randomTime = System.currentTimeMillis();
@@ -139,7 +143,14 @@
core.script.runJava(newRequest.scriptFile, command, is.plugin);
WebRequest processedRequest = (WebRequest) core.temp.get(randomId);
- String result = processedRequest.getAnswer();
+
+ // we might have cases where the request is null
+ String result = "";
+ if(processedRequest != null){
+ result = processedRequest.getAnswer();
+ //return null;
+ }
+
// remove it from the memory
core.temp.remove(randomId);