add null check when cropping a bitmap.

The original CL was missing a negation in an if statement and
had to be reverted. This CL reapplies the change with the
necessary correction.

This reverts commit aafd212a55b35fd004aeabb22a25cd3476801798.

bug: 5860912
Change-Id: I68654747229ebeabb34a427397728d4815e68bca
1 file changed