Add check to prevent possible IllegalStateException

This commit is contained in:
emanuele-f 2022-06-29 10:28:59 +02:00
parent 2e0eb68f63
commit 0d25474ea4

View File

@ -318,6 +318,9 @@ public class StatusFragment extends Fragment implements AppStateListener, AppsLo
if((app != null) && (app.getIcon() != null)) {
// Rendering after mCollectorInfo.setText is deferred, so getMeasuredHeight must be postponed
mHandler.post(() -> {
if(getContext() == null)
return;
int height = mCollectorInfo.getMeasuredHeight();
Drawable drawable = Utils.scaleDrawable(getResources(), app.getIcon(), height, height);