Skip to content

Commit

Permalink
Report caller context if settable drawee hierarchy is null
Browse files Browse the repository at this point in the history
Reviewed By: oprisnik

Differential Revision: D50572603

fbshipit-source-id: 3dc244f87b769fa7e3ecbc4be8a622410e180d4d
  • Loading branch information
Artem Kholodnyi authored and facebook-github-bot committed Oct 24, 2023
1 parent 96a43e2 commit c266579
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -649,16 +649,16 @@ private void onNewResultInternal(
if (isFinished) {
logMessageAndImage("set_final_result @ onNewResult", image);
mDataSource = null;
mSettableDraweeHierarchy.setImage(drawable, 1f, wasImmediate);
getSettableDraweeHierarchy().setImage(drawable, 1f, wasImmediate);
reportSuccess(id, image, dataSource);
} else if (deliverTempResult) {
logMessageAndImage("set_temporary_result @ onNewResult", image);
mSettableDraweeHierarchy.setImage(drawable, 1f, wasImmediate);
getSettableDraweeHierarchy().setImage(drawable, 1f, wasImmediate);
reportSuccess(id, image, dataSource);
// IMPORTANT: do not execute any instance-specific code after this point
} else {
logMessageAndImage("set_intermediate_result @ onNewResult", image);
mSettableDraweeHierarchy.setImage(drawable, progress, wasImmediate);
getSettableDraweeHierarchy().setImage(drawable, progress, wasImmediate);
reportIntermediateSet(id, image);
// IMPORTANT: do not execute any instance-specific code after this point
}
Expand Down Expand Up @@ -889,4 +889,13 @@ private Extras obtainExtras(
}

public abstract @Nullable Map<String, Object> obtainExtrasFromImage(INFO info);

private SettableDraweeHierarchy getSettableDraweeHierarchy() {
SettableDraweeHierarchy hierarchy = mSettableDraweeHierarchy;
if (hierarchy == null) {
throw new IllegalStateException(
"mSettableDraweeHierarchy is null; Caller context: " + mCallerContext);
}
return hierarchy;
}
}

0 comments on commit c266579

Please sign in to comment.