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

View file

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