Fix NPE when System property os.name does not exist. See #669 and #679

This commit is contained in:
Norman Maurer 2012-10-24 18:46:56 +02:00
parent e3cf41c9fb
commit 99698a5272

View File

@ -38,7 +38,7 @@ public final class DetectionUtil {
private static final boolean HAS_UNSAFE = hasUnsafe(AtomicInteger.class.getClassLoader());
private static final boolean IS_WINDOWS;
static {
String os = SystemPropertyUtil.get("os.name").toLowerCase();
String os = SystemPropertyUtil.get("os.name", "").toLowerCase();
// windows
IS_WINDOWS = os.indexOf("win") >= 0;
}