Fix NPE calling the text() method with a nil parameter from JRuby.