Avoid NullPointerException when using Java Strings

Avoid NullPointerException when using Java Strings