Fix NullPointerException for Constant Null value

Originally contributed by @chenghao-intel