Fix NPE
This commit is contained in:
parent
1c6f0b371d
commit
810658a364
3 changed files with 6 additions and 5 deletions
|
@ -1212,7 +1212,7 @@ public class GPXUtilities {
|
|||
fout.getParentFile().mkdirs();
|
||||
output = new OutputStreamWriter(new FileOutputStream(fout), "UTF-8"); //$NON-NLS-1$
|
||||
String msg = writeGpx(output, file, ctx);
|
||||
if(file.path == null) {
|
||||
if(Algorithms.isEmpty(file.path)) {
|
||||
file.path = fout.getAbsolutePath();
|
||||
}
|
||||
return msg;
|
||||
|
|
|
@ -72,11 +72,13 @@ public class TrackActivity extends TabActivity {
|
|||
finish();
|
||||
return;
|
||||
}
|
||||
file = null;
|
||||
if (intent.hasExtra(TRACK_FILE_NAME)) {
|
||||
file = new File(intent.getStringExtra(TRACK_FILE_NAME));
|
||||
}
|
||||
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
if (intent.hasExtra(TRACK_FILE_NAME)) {
|
||||
file = new File(intent.getStringExtra(TRACK_FILE_NAME));
|
||||
if(file != null) {
|
||||
String fn = file.getName().replace(".gpx", "").replace("/", " ").replace("_", " ");
|
||||
actionBar.setTitle(fn);
|
||||
} else {
|
||||
|
|
|
@ -239,7 +239,6 @@ public class WikivoyageLocalDataHelper {
|
|||
conn.execSQL(BOOKMARKS_TABLE_CREATE);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private void onUpgrade(SQLiteConnection conn, int oldVersion, int newVersion) {
|
||||
if (oldVersion < 2) {
|
||||
conn.execSQL(BOOKMARKS_TABLE_CREATE);
|
||||
|
|
Loading…
Reference in a new issue