Added exception catching to updateUI in an attempt to fix #176

This commit is contained in:
Graham Jones
2024-05-08 21:56:51 +01:00
parent d47df2fb97
commit bcb5f80df5

View File

@@ -111,7 +111,16 @@ public class FragmentOsdBaseClass extends Fragment {
updateUiHandler.post(new Runnable() {
@Override
public void run() {
updateUi();
// Check for context being null is an attempt to stop the crashes reported in Issue No 176
if (mContext != null) {
try {
updateUi();
} catch (Exception e) {
Log.e(TAG,"upateUiOnUiThread() - exception updating UI - "+e.getMessage());
}
} else {
Log.e(TAG,"updateUionUiThread() - mContext is null?? Can't show a Toast message because context is null....");
}
}
});
}