Skip to content

Commit

Permalink
fix(android): add null-guard for activity in listview (#13624)
Browse files Browse the repository at this point in the history
  • Loading branch information
hansemannn committed Oct 28, 2022
1 parent bb89d44 commit 34c8b9d
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -765,6 +765,12 @@ public void update(boolean force)
final Activity activity = TiApplication.getAppCurrentActivity();
final View previousFocus = activity != null ? activity.getCurrentFocus() : null;

// The activity may be not available anymore, e.g. when a HTTP request started to update the list, but the containing window
// was closed before the operation could be completed.
if (activity == null) {
return;
}

activity.runOnUiThread(new Runnable()
{
@Override
Expand Down

0 comments on commit 34c8b9d

Please sign in to comment.