Don't NPE if properties param isn't set; allow overriding torrent behavior for testing

This commit is contained in:
Elizabeth Fong
2006-10-19 20:39:02 +00:00
parent cd02c01f30
commit 5644e62dc5
2 changed files with 11 additions and 7 deletions
@@ -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;