Fix potential NPE with null cursor

Detect and handle null cursors returned from CP2 queries.

Bug:12767708
Change-Id: I1571463b80e5b85656fe119c6bc83de36be30c7f
3 files changed