email: prevent NPE caused by null cursors

Change-Id: If819f14d4cf25d6ba35110a7a22125909a6f87dc