diff --git a/src/main/java/com/threerings/getdown/launcher/GetdownApp.java b/src/main/java/com/threerings/getdown/launcher/GetdownApp.java index d25d4cb..8cd431f 100644 --- a/src/main/java/com/threerings/getdown/launcher/GetdownApp.java +++ b/src/main/java/com/threerings/getdown/launcher/GetdownApp.java @@ -196,8 +196,8 @@ public class GetdownApp protected void showDocument (String url) { String[] cmdarray; if (RunAnywhere.isWindows()) { - String osName = System.getProperty("os.name"); - if (osName != null && (osName.indexOf("9") != -1 || osName.indexOf("Me") != -1)) { + String osName = System.getProperty("os.name", ""); + if (osName.indexOf("9") != -1 || osName.indexOf("Me") != -1) { cmdarray = new String[] { "command.com", "/c", "start", "\"" + url + "\"" }; } else { diff --git a/src/main/java/com/threerings/getdown/util/FileUtil.java b/src/main/java/com/threerings/getdown/util/FileUtil.java index 9d6f2ef..f0ebb57 100644 --- a/src/main/java/com/threerings/getdown/util/FileUtil.java +++ b/src/main/java/com/threerings/getdown/util/FileUtil.java @@ -188,19 +188,16 @@ public class FileUtil public static void walkTree (File root, Visitor visitor) { File[] children = root.listFiles(); - if (children != null) { - Deque stack = new ArrayDeque<>(Arrays.asList(children)); - while (!stack.isEmpty()) { - File currentFile = stack.pop(); - if (currentFile.exists()) { - visitor.visit(currentFile); - if (currentFile.isDirectory()) { - File[] currentChildren = currentFile.listFiles(); - if (currentChildren != null) { - for (File file : currentChildren) { - stack.push(file); - } - } + if (children == null) return; + Deque stack = new ArrayDeque<>(Arrays.asList(children)); + while (!stack.isEmpty()) { + File currentFile = stack.pop(); + if (currentFile.exists()) { + visitor.visit(currentFile); + File[] currentChildren = currentFile.listFiles(); + if (currentChildren != null) { + for (File file : currentChildren) { + stack.push(file); } } } diff --git a/src/main/java/com/threerings/getdown/util/LaunchUtil.java b/src/main/java/com/threerings/getdown/util/LaunchUtil.java index 8c6efc7..720515a 100644 --- a/src/main/java/com/threerings/getdown/util/LaunchUtil.java +++ b/src/main/java/com/threerings/getdown/util/LaunchUtil.java @@ -182,13 +182,8 @@ public class LaunchUtil */ public static boolean mustMonitorChildren () { - String osname = System.getProperty("os.name"); - if (osname != null) { - osname = osname.toLowerCase(); - return (osname.indexOf("windows 98") != -1 || osname.indexOf("windows me") != -1); - } else { - return false; - } + String osname = System.getProperty("os.name", "").toLowerCase(); + return (osname.indexOf("windows 98") != -1 || osname.indexOf("windows me") != -1); } /**