Check for coords before using it

This commit is contained in:
Sebastian Serth
2020-11-11 17:35:06 +01:00
parent 24c0a8ce50
commit 664dadf404

View File

@ -180,10 +180,13 @@ Turtle.prototype.create_polygon = function () {
// XXX might make this varargs as in Tkinter
Turtle.prototype.coords = function (item, coords) {
if (coords === undefined) {
if (this.items[item] === undefined) {
return;
} else if (coords === undefined) {
return this.items[item].coords;
} else {
this.items[item].coords = coords;
}
this.items[item].coords = coords;
};
Turtle.prototype.itemconfigure = function (item, key, value) {