Replace null and undefined with a java null when dispatching to java.