mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-07 03:53:05 +02:00
Switch order of literals to prevent NullPointerException (#4)
Co-authored-by: pixeebot[bot] <23113631+pixeebot@users.noreply.github.com>
This commit is contained in:
committed by
Hosted Weblate
parent
aae1a4d65d
commit
83445cfde0
@@ -494,7 +494,7 @@ public class KMLTrackExporter implements TrackExporter {
|
||||
}
|
||||
|
||||
private void writeActivityType(String activityTypeLocalized) {
|
||||
if (activityTypeLocalized == null || activityTypeLocalized.equals("")) {
|
||||
if (activityTypeLocalized == null || "".equals(activityTypeLocalized)) {
|
||||
return;
|
||||
}
|
||||
printWriter.println("<ExtendedData>");
|
||||
|
||||
@@ -415,7 +415,7 @@ public class KmlTrackImporter extends DefaultHandler implements XMLImporter.Trac
|
||||
Float value = null;
|
||||
if (content != null) {
|
||||
content = content.trim();
|
||||
if (!content.equals("")) {
|
||||
if (!"".equals(content)) {
|
||||
try {
|
||||
value = Float.parseFloat(content);
|
||||
} catch (NumberFormatException e) {
|
||||
|
||||
@@ -230,7 +230,7 @@ public class KmzTrackImporter {
|
||||
*/
|
||||
@Deprecated //TODO Use JDK9's inputStream.transferTo() instead of manual buffer
|
||||
private void readAndSaveImageFile(ZipInputStream zipInputStream, Track.Id trackId, String fileName) throws IOException {
|
||||
if (trackId == null || fileName.equals("")) {
|
||||
if (trackId == null || "".equals(fileName)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user