Null pointer crash in String.format