Put defensive code in order to Avoid NPE for testing.