Android: Fix a possible exception when refreshing game list

This commit is contained in:
Connor McLaughlin 2021-01-20 14:45:04 +10:00
parent 4e802e90ca
commit fb48e8f093
1 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package com.github.stenzek.duckstation;
import android.app.Activity;
import android.os.AsyncTask;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -38,7 +39,12 @@ public class GameList {
Arrays.sort(newEntries, new GameListEntryComparator());
mContext.runOnUiThread(() -> {
try {
progressCallback.dismiss();
} catch (Exception e) {
Log.e("GameList", "Exception dismissing refresh progress");
e.printStackTrace();
}
mEntries = newEntries;
mAdapter.notifyDataSetChanged();
});