community-edition
community-edition copied to clipboard
#setLabel breaks if the label is set to undefined
Following code will throw an exception:
conn.getOverlay("label").setLabel(undefined);
conn.getOverlay("label").setLabel("I told you that");
The problem is that the setLabel method attempts to call a replace method on a passed parameter, and it assumes it is a type of String. The setLabel method should check the parameter for being null or at least store it internally with the code
this.label = param || "";
to ensure we do not end up with exceptions.