mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Fix possible NPE from null action
This commit is contained in:
parent
308d91de1c
commit
05b9f0af9b
|
@ -97,7 +97,7 @@ public final class SearchBookContentsActivity extends Activity {
|
||||||
CookieManager.getInstance().removeExpiredCookie();
|
CookieManager.getInstance().removeExpiredCookie();
|
||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
if (intent == null || !intent.getAction().equals(Intents.SearchBookContents.ACTION)) {
|
if (intent == null || !Intents.SearchBookContents.ACTION.equals(intent.getAction())) {
|
||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,9 +74,9 @@ final class QRCodeEncoder {
|
||||||
this.dimension = dimension;
|
this.dimension = dimension;
|
||||||
this.useVCard = useVCard;
|
this.useVCard = useVCard;
|
||||||
String action = intent.getAction();
|
String action = intent.getAction();
|
||||||
if (action.equals(Intents.Encode.ACTION)) {
|
if (Intents.Encode.ACTION.equals(action)) {
|
||||||
encodeContentsFromZXingIntent(intent);
|
encodeContentsFromZXingIntent(intent);
|
||||||
} else if (action.equals(Intent.ACTION_SEND)) {
|
} else if (Intent.ACTION_SEND.equals(action)) {
|
||||||
encodeContentsFromShareIntent(intent);
|
encodeContentsFromShareIntent(intent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue