Merge "handle java.lang.NullPointerException" into tm-dev