Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Null check route list #697

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,16 @@ private void setupList() {
RecyclerView recyclerView = findViewById(R.id.gpx_list);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.addItemDecoration(new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL));
try {
Cursor cursor = dbHelper.routeMetaIterator();
final DateFormat itemDateFormat = android.text.format.DateFormat.getDateFormat(this.getApplicationContext());
final DateFormat itemTimeFormat = android.text.format.DateFormat.getTimeFormat(this.getApplicationContext());
GpxRecyclerAdapter adapter = new GpxRecyclerAdapter(this, this, cursor, this, this, prefs, itemDateFormat, itemTimeFormat);
recyclerView.setAdapter(adapter);
} catch (DBException dbex) {
Logging.error("Failed to setup list for GPX management: ", dbex);
if (null != dbHelper) {
try {
Cursor cursor = dbHelper.routeMetaIterator();
final DateFormat itemDateFormat = android.text.format.DateFormat.getDateFormat(this.getApplicationContext());
final DateFormat itemTimeFormat = android.text.format.DateFormat.getTimeFormat(this.getApplicationContext());
GpxRecyclerAdapter adapter = new GpxRecyclerAdapter(this, this, cursor, this, this, prefs, itemDateFormat, itemTimeFormat);
recyclerView.setAdapter(adapter);
} catch (DBException dbex) {
Logging.error("Failed to setup list for GPX management: ", dbex);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,11 @@ public void handleMessage( final Message msg ) {
}

final MainActivity mainActivity = MainActivity.getMainActivity();
final Intent errorReportIntent = new Intent( mainActivity, ErrorReportActivity.class );
errorReportIntent.putExtra( ERROR_REPORT_DIALOG, error );
mainActivity.startActivity( errorReportIntent );
if (null != mainActivity) {
final Intent errorReportIntent = new Intent(mainActivity, ErrorReportActivity.class);
errorReportIntent.putExtra(ERROR_REPORT_DIALOG, error);
mainActivity.startActivity(errorReportIntent);
}
}
}

Expand Down
Loading