Fixing leftovers from the merge

This commit is contained in:
Rodrigo Damazio
2011-06-14 20:48:00 -03:00
parent 9ee053e4f9
commit 51df795a8c
2 changed files with 17 additions and 4 deletions
@@ -83,6 +83,11 @@ public class SaveActivity extends Activity {
shareFile = intent.getBooleanExtra(EXTRA_SHARE_FILE, false);
writer = TrackWriterFactory.newWriter(this, providerUtils, trackId, format);
if (writer == null) {
Log.e(TAG, "Unable to build writer");
finish();
return;
}
if (shareFile) {
// If the file is for sending, save it to a temporary location instead.
@@ -223,8 +223,12 @@ public class SendActivity extends Activity implements ProgressIndicator {
// Update the map id for this track:
try {
Track track = providerUtils.getTrack(sendTrackId);
track.setMapId(mapId);
providerUtils.updateTrack(track);
if (track != null) {
track.setMapId(mapId);
providerUtils.updateTrack(track);
} else {
Log.w(TAG, "Updating map id failed.");
}
} catch (RuntimeException e) {
// If that fails whatever reasons we'll just log an error, but
// continue.
@@ -280,8 +284,12 @@ public class SendActivity extends Activity implements ProgressIndicator {
// Update the table id for this track:
try {
Track track = providerUtils.getTrack(sendTrackId);
track.setTableId(tableId);
providerUtils.updateTrack(track);
if (track != null) {
track.setTableId(tableId);
providerUtils.updateTrack(track);
} else {
Log.w(TAG, "Updating table id failed.");
}
} catch (RuntimeException e) {
// If that fails whatever reasons we'll just log an error, but
// continue.