added test for verifying that entities null doesn't cause error - issue #323