forked from upstream-mirrors/OpenTracks
Only clean if parse error is out of <trk>
This commit is contained in:
+3
-2
@@ -126,11 +126,12 @@ abstract class AbstractFileTrackImporter extends DefaultHandler implements Track
|
|||||||
return trackIds.get(0);
|
return trackIds.get(0);
|
||||||
} catch (IOException | SAXException | ParserConfigurationException e) {
|
} catch (IOException | SAXException | ParserConfigurationException e) {
|
||||||
Log.e(TAG, "Unable to import file", e);
|
Log.e(TAG, "Unable to import file", e);
|
||||||
cleanImport();
|
if (trackIds.size() > 0) {
|
||||||
|
cleanImport();
|
||||||
|
}
|
||||||
throw new ImportParserException(e);
|
throw new ImportParserException(e);
|
||||||
} catch (SQLiteConstraintException e) {
|
} catch (SQLiteConstraintException e) {
|
||||||
Log.e(TAG, "Unable to import file", e);
|
Log.e(TAG, "Unable to import file", e);
|
||||||
cleanImport();
|
|
||||||
throw new ImportAlreadyExistsException(e);
|
throw new ImportAlreadyExistsException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user