Exception in GoJS 1.5.22 after inline edit and undo


We are experiencing an exception being thrown in GoJS. I suspect this won’t normally be seen by an end user but we capture all exceptions and log them so we are seeing it quite frequently. I can now reproduce it in Chrome when I edit the name of an object via the inline editor and then perform an undo.

The error message is Cannot read property ‘Xu’ of null and occurs at line 622 of the debug source in the following bit of code

a.addEventListener(“input”,function(){var a=this.textEditingTool,c=a.PC;c.text=this.value;var d=this.jJ;Yh(c,a.Gf.Xu,Infinity);this.style.width=20+c.Ja.widthd+“px”;this.style.height=10+c.Ja.heightd+“px”;this.rows=c.gI},!1);

There is no call stack, presumably because this gets called in response to an event somewhere, so there’s nothing I can directly change in my code to fix it.

I assume a.Gf is null when this is being called hence the error. I guess a fix would just be a check for null, but if that isn’t possible, has this been seen before and any ideas as to what is causing it (i.e something in my code?).

I should have said, this occurs if I do an inline edit, then click elsewhere then perform an undo. One thing I’ve noticed is the exception is raised if I use CTRL Z to attempt the undo but doesn’t happen if I use our toolbar button. That suggests to me that the inline editor is registering an event handler for the CTRL Z key combination but isn’t unregistering it?

Could you tell us how to reproduce the problem?

If you try what you said in one of the sample apps, such as http://gojs.net/latest/samples/basic.html, do you get that exception?

Hmm, no it doesn’t happen in that example. So I guess it must be something related to the rest of our application. I’ll try to produce a stripped down example or find the underlying cause

I see what might be wrong in the source code here, but we’re really interested in the scenario that caused this issue. Could you put your code up publicly somewhere, or make us a reduced case?

I could give you access to our application, but all the code is minified so it may not be that useful? I’m just ripping things out at the moment to see if I can produce a test case

OK. Either might do, let us know. If you don’t want to post anything publicly you can email us, “gojs (at) nwoods.com

We have a provisional fix, but we want to be certain that there are no other related issues before we issue a new version.

Now you can try 1.5.23: GoJS version 1.5.23

Great, I will give it a spin