Switch order of literals to prevent NullPointerException (#4)

Co-authored-by: pixeebot[bot] <23113631+pixeebot@users.noreply.github.com>
This commit is contained in:
pixeebot[bot]
2023-09-22 08:24:09 -04:00
committed by Hosted Weblate
parent aae1a4d65d
commit 83445cfde0
6 changed files with 12 additions and 12 deletions
@@ -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;
}