Skip to content
Snippets Groups Projects
Commit 7b673c72 authored by Yohei Yukawa's avatar Yohei Yukawa Committed by Android Git Automerger
Browse files

am 5139c4fd: am 702a736e: am 31838876: am 9baaa4b5: am 6ad437ed: Merge "Fix...

am 5139c4fd: am 702a736e: am 31838876: am 9baaa4b5: am 6ad437ed: Merge "Fix NPE due to the lack of null-check" into lmp-dev

* commit '5139c4fd':
  Fix NPE due to the lack of null-check
parents a850cda0 5139c4fd
No related branches found
No related tags found
No related merge requests found
......@@ -84,8 +84,8 @@ public final class CursorAnchorInfoCompatWrapper {
}
@UsedForTesting
public static boolean isAvailable() {
return sCursorAnchorInfoClass.exists();
public boolean isAvailable() {
return sCursorAnchorInfoClass.exists() && mInstance != null;
}
private Object mInstance;
......@@ -96,7 +96,7 @@ public final class CursorAnchorInfoCompatWrapper {
@UsedForTesting
public static CursorAnchorInfoCompatWrapper fromObject(final Object instance) {
if (!isAvailable()) {
if (!sCursorAnchorInfoClass.exists()) {
return new CursorAnchorInfoCompatWrapper(null);
}
return new CursorAnchorInfoCompatWrapper(instance);
......
......@@ -182,7 +182,7 @@ public class TextDecorator {
private void layoutMain() {
final CursorAnchorInfoCompatWrapper info = mCursorAnchorInfoWrapper;
if (info == null) {
if (info == null || !info.isAvailable()) {
cancelLayoutInternalExpectedly("CursorAnchorInfo isn't available.");
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment