Ported r2892 from ZXing
Ported r2892 from ZXing

Original commit message: "Issue 1778 maybe avoid NPE"

Kalvar/ZXingObjC,rkpant/ZXingObjC,Stocard/ZXingObjC,jianwoo/ZXingObjC,Kevin775263419/ZXingObjC,JeremyPacker/ZXingObjC,ufs-slizhik/ZXingObjC,TheLevelUp/ZXingObjC,rkpant/ZXingObjC,fanwenkai/ZXingObjC,zeffon/ZXingObjC,Kalvar/ZXingObjC,zilaiyedaren/ZXingObjC,davidjackman/ZXingObjC,xuxubin/ZXingObjC,ufs-slizhik/ZXingObjC,fuzhiqiang1989/ZXingObjC,benjohnde/ZXingObjC,adan016/ZXingObjC,tejesh-alimilli/ZXingObjC,sdhzwm/ZXingObjC,rowliny/ZXingObjC,peacemoon/ZXingObjC,YotrolZ/ZXingObjC,trsathya/ZXingObjC,RockyAo/ZXingObjC,fanwenkai/ZXingObjC,peacemoon/ZXingObjC,benjohnde/ZXingObjC,jebai0521/ZXingObjC,YotrolZ/ZXingObjC,RockyAo/ZXingObjC,sdhzwm/ZXingObjC,cortices/ZXingObjC,trsathya/ZXingObjC,adan016/ZXingObjC,fuzhiqiang1989/ZXingObjC,Kevin775263419/ZXingObjC,zeffon/ZXingObjC,Stocard/ZXingObjC,elegion/ios-pods-ZXingObjC,xuxubin/ZXingObjC,elegion/ios-pods-ZXingObjC,wuxsoft/ZXingObjC,zilaiyedaren/ZXingObjC,wuxsoft/ZXingObjC,JeremyPacker/ZXingObjC,tejesh-alimilli/ZXingObjC,jianwoo/ZXingObjC,davidjackman/ZXingObjC,jebai0521/ZXingObjC,cortices/ZXingObjC,TheLevelUp/ZXingObjC,rowliny/ZXingObjC