Skip to content

Commit

Permalink
Resolves #3280 Empty String instead of N/A
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-kolb committed Oct 11, 2017
1 parent 1b030b4 commit dba3b7a
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,16 @@ public FileAnnotationViewModel(FileAnnotation annotation) {

private void setupContentProperties(FileAnnotation annotation) {
if (annotation.hasLinkedAnnotation()) {
this.content.set(toNAifEmpty(annotation.getLinkedFileAnnotation().getContent()));
this.content.set(annotation.getLinkedFileAnnotation().getContent());
String annotationContent = annotation.getContent();
String illegibleTextMessage = Localization.lang("The marked area does not contain any legible text!");
this.marking.set(annotationContent.isEmpty() ? illegibleTextMessage : annotationContent);
} else {
this.content.set(toNAifEmpty(annotation.getContent()));
this.marking.set("N/A");
this.content.set(annotation.getContent());
this.marking.set("");
}
}

private static String toNAifEmpty(String content) {
if (content.isEmpty()) {
return "N/A";
}
return content;
}

public String getAuthor() {
return author.get();
}
Expand Down

0 comments on commit dba3b7a

Please sign in to comment.