Fix NPE on WebStorm8 (fixes #671)

As the title says :)