diff --git a/src/main/java/de/dennisguse/opentracks/io/file/importer/KmzTrackImporter.java b/src/main/java/de/dennisguse/opentracks/io/file/importer/KmzTrackImporter.java index 8eb440c9b..100ff406b 100644 --- a/src/main/java/de/dennisguse/opentracks/io/file/importer/KmzTrackImporter.java +++ b/src/main/java/de/dennisguse/opentracks/io/file/importer/KmzTrackImporter.java @@ -177,6 +177,10 @@ public class KmzTrackImporter implements TrackImporter { zipInputStream.closeEntry(); } + if (trackId == null) { + Log.d(TAG, "Unable to find doc.kml in kmz"); + throw new RuntimeException(context.getString(R.string.import_no_kml_file_found)); + } return trackId; } catch (ImportParserException | ImportAlreadyExistsException e) { Log.e(TAG, "Unable to import file", e); diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 3838e33e6..e4f56c08b 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -290,6 +290,7 @@ limitations under the License. Unsupported file format Parser error: %1$s Unable to import file: %1$s + No doc.kml file found in KMZ %1$s: %2$s Files not imported File %1$s imported