← All bug reports

FS#2103Crash when lengthen() executed twice

Type
Bug
Status
Closed
Resolution
Not a bug
Category
ECMAScript
Severity
Low
Priority
Low
Reported version
3.24.3
Operating system
macOS High Sierra (10.13)
Reported
2020-08-03 by syroezhkin
Closed
2020-08-05 by andrew
Votes
1

This code was executed in the Script Shell window. Then the program is failing of and closed.

a = addLine(0,0,100,100);
lengthen(a, true, 50); // success
lengthen(a, true, 50); // FAILED!

Comments (2)

andrew 2020-08-05

Please try:

a = addLine(0,0,100,100);
var id = a.getId();

a = doc.queryEntity(id);
lengthen(a, true, 50);

a = doc.queryEntity(id);
lengthen(a, true, 50);
syroezhkin 2020-08-05

I executed your script and it ran successfully. Interestingly after this I can call the length(a, true, 50); function an unlimited number of times and the program now doesn't crash.

But it seems to me that functions should not behave so unpredictably... So I thought it was a bug.

P.S. I inserted var doc = this.getDocument(); at the beginning.