Fixed NPE on getting null item of collection.

Fixed NullPointerException on getting null item of collection.