java.lang.nullpointerexception cannot invoke string.length() because name is null