bug fix, handle the case when gx:value in kml is empty

This commit is contained in:
Jimmy Shih
2014-01-17 13:06:06 -08:00
parent 0ccd70a7b9
commit 28801a1332
@@ -293,10 +293,16 @@ public class KmlFileTrackImporter extends AbstractFileTrackImporter {
* On sensor value end. gx:value end tag.
*/
private void onSensorValueEnd() throws SAXException {
if (content != null) {
if (content == null) {
return;
}
content = content.trim();
if (content.equals("")) {
return;
}
int value;
try {
value = Integer.parseInt(content.trim());
value = Integer.parseInt(content);
} catch (NumberFormatException e) {
throw new SAXException(createErrorMessage("Unable to parse gx:value:" + content), e);
}
@@ -309,4 +315,3 @@ public class KmlFileTrackImporter extends AbstractFileTrackImporter {
}
}
}
}