changed (text.length == 1 && text != null) to (text.length == 1)