Avoid an NPE by checking for null handler

git-svn-id: https://zxing.googlecode.com/svn/trunk@2864 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen@gmail.com 2013-08-08 10:51:24 +00:00
parent e4432a0991
commit 99f4f03f9a

View file

@ -668,11 +668,13 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
}
private void sendReplyMessage(int id, Object arg, long delayMS) {
Message message = Message.obtain(handler, id, arg);
if (delayMS > 0L) {
handler.sendMessageDelayed(message, delayMS);
} else {
handler.sendMessage(message);
if (handler != null) {
Message message = Message.obtain(handler, id, arg);
if (delayMS > 0L) {
handler.sendMessageDelayed(message, delayMS);
} else {
handler.sendMessage(message);
}
}
}