OSDN Git Service

Null check intent before starting "learn more".
authorAndrew Sapperstein <asapperstein@google.com>
Tue, 3 May 2016 01:28:21 +0000 (18:28 -0700)
committerAndrew Sapperstein <asapperstein@google.com>
Tue, 3 May 2016 18:01:35 +0000 (11:01 -0700)
It is possible in certain build configurations to have an invalid
link. Instead of crashing, swallow the error and write to logs.

BUG: 28381984
Change-Id: I19f20b96afb42758187707f1b86a5817e8d737a8

src/com/android/settings/fingerprint/FingerprintEnrollIntroduction.java

index a65d6a4..3c0cc4b 100644 (file)
@@ -183,6 +183,10 @@ public class FingerprintEnrollIntroduction extends FingerprintEnrollBase
         public void onClick(View widget) {
             Context ctx = widget.getContext();
             Intent intent = HelpUtils.getHelpIntent(ctx, getURL(), ctx.getClass().getName());
+            if (intent == null) {
+                Log.w(LearnMoreSpan.TAG, "Null help intent.");
+                return;
+            }
             try {
                 // This needs to be startActivityForResult even though we do not care about the
                 // actual result because the help app needs to know about who invoked it.