Bug 1399148 - Check we actually have an Editable before searching for a span. r?jwu
MozReview-Commit-ID: EiUO8wWSyLB
--- a/mobile/android/app/src/photon/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
+++ b/mobile/android/app/src/photon/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
@@ -438,17 +438,17 @@ public class ToolbarDisplayLayout extend
// on the safe side.
mTitleScroll.scrollTo(0, 0);
}
return;
}
final ForegroundColorSpan spanToCheck =
mTitle.isPrivateMode() ? mPrivateDomainColorSpan : mDomainColorSpan;
- int domainEnd = text.getSpanEnd(spanToCheck);
+ final int domainEnd = text != null ? text.getSpanEnd(spanToCheck) : -1;
if (domainEnd == -1) {
// We're not showing a domain, just scroll to the start of the text.
mTitleScroll.scrollTo(0, 0);
return;
}
// If we're showing an URL that is larger than the URL bar, we want to align the end of
// the domain part with the right side of URL bar, so as to put the focus on the base