Add check for decimalCoords != null

This commit is contained in:
misaochan 2016-09-13 01:03:00 +12:00
parent 777d52e39b
commit 06a8cc6d49

View file

@ -134,7 +134,6 @@ public class Contribution extends Media {
StringBuffer buffer = new StringBuffer();
SimpleDateFormat isoFormat = new SimpleDateFormat("yyyy-MM-dd");
//TODO: Add location template immediately after Information template. {{Location|37.51136|-77.602615}}
buffer
.append("== {{int:filedesc}} ==\n")
.append("{{Information\n")
@ -146,9 +145,14 @@ public class Contribution extends Media {
.append("|date={{According to EXIF data|").append(isoFormat.format(dateCreated)).append("}}\n");
}
buffer
.append("}}").append("\n")
.append("{{Location|").append(decimalCoords).append("}}").append("\n")
.append("== {{int:license-header}} ==\n")
.append("}}").append("\n");
//Only add Location template (e.g. {{Location|37.51136|-77.602615}} ) if coords is not null
if (decimalCoords != null) {
buffer.append("{{Location|").append(decimalCoords).append("}}").append("\n");
}
buffer.append("== {{int:license-header}} ==\n")
.append(Utils.licenseTemplateFor(getLicense())).append("\n\n")
.append("{{Uploaded from Mobile|platform=Android|version=").append(CommonsApplication.APPLICATION_VERSION).append("}}\n")
.append(getTrackingTemplates());