Sometimes System.getProperty("os.name") can be null

The same kind of check is done by apache commons-lang SystemUtils, see http://grepcode.com/file/repo1.maven.org/maven2/commons-lang/commons-lang/2.6/org/apache/commons/lang/SystemUtils.java#SystemUtils.isOSNameMatch%28java.lang.String%2Cjava.lang.String%29