Update DirectMapMapping.java

Adding a null pointer check, null pointer exception can be thrown here