Don't NPE if properties param isn't set; allow overriding torrent behavior for testing
This commit is contained in:
@@ -439,7 +439,8 @@ public class Application
|
||||
}
|
||||
|
||||
// determine whether or not we should be using bit torrent
|
||||
_useTorrent = (cdata.get("torrent") != null);
|
||||
_useTorrent = (cdata.get("torrent") != null) ||
|
||||
(System.getProperty("torrent") != null);
|
||||
|
||||
// look for a debug.txt file which causes us to run in java.exe on
|
||||
// Windows so that we can obtain a thread dump of the running JVM
|
||||
|
||||
@@ -99,13 +99,16 @@ public class GetdownApplet extends JApplet
|
||||
}
|
||||
|
||||
// Pass through properties parameter.
|
||||
String[] properties = getParameter("properties").split(" ");
|
||||
for (String property : properties) {
|
||||
String properties = getParameter("properties");
|
||||
if (properties != null) {
|
||||
String[] proparray = properties.split(" ");
|
||||
for (String property : proparray) {
|
||||
String key = property.substring(property.indexOf("-D") + 2,
|
||||
property.indexOf("="));
|
||||
String value = property.substring(property.indexOf("=") + 1);
|
||||
System.setProperty(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
// when run from an applet, we install
|
||||
String root;
|
||||
|
||||
Reference in New Issue
Block a user