Guess at avoiding an NPE reported by a user

git-svn-id: https://zxing.googlecode.com/svn/trunk@1970 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2011-10-14 08:41:14 +00:00
parent 359551d6e7
commit 27a047ebe2

View file

@ -567,10 +567,12 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
} else if (source == Source.ZXING_LINK) {
// Replace each occurrence of RETURN_CODE_PLACEHOLDER in the returnUrlTemplate
// with the scanned code. This allows both queries and REST-style URLs to work.
Message message = Message.obtain(handler, R.id.launch_product_query);
message.obj = returnUrlTemplate.replace(RETURN_CODE_PLACEHOLDER,
resultHandler.getDisplayContents().toString());
handler.sendMessageDelayed(message, INTENT_RESULT_DURATION);
if (returnUrlTemplate != null) {
Message message = Message.obtain(handler, R.id.launch_product_query);
message.obj = returnUrlTemplate.replace(RETURN_CODE_PLACEHOLDER,
String.valueOf(resultHandler.getDisplayContents()));
handler.sendMessageDelayed(message, INTENT_RESULT_DURATION);
}
}
}