Skip to content

Commit 4de9dee

Browse files
committed
Don't create null annotations, or else the immutable map will fail
1 parent 5a857fc commit 4de9dee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/edu/cmu/cs/openslide/gui/Annotation.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,15 @@ public Bean() {
6363
}
6464

6565
public Annotation toAnnotation() {
66-
Map<String, String> annotations = null;
66+
Map<String, String> annotations;
6767
if (this.annotations != null) {
6868
annotations = new HashMap<String, String>();
6969
for (int i = 0; i < this.annotations.length; i++) {
7070
Pair p = this.annotations[i];
7171
annotations.put(p.getName(), p.getValue());
7272
}
73+
} else {
74+
annotations = Collections.emptyMap();
7375
}
7476

7577
String[] segs = shape.split(" ");

0 commit comments

Comments
 (0)