Fixes NPE in HtmlWriter.writeGridJavaScript.