Misreported error

Just had a quite weird case – in a file-save interface, my prSave method gets the path as |p|. Then I mistakenly used the member variable path when calling a component object to save itself. This is unpopulated upon first save, so it’s nil. Then when that component object calls String methods to manipulate the path, it fails, bounces back to the protect block, whereupon I got an error report for close not being understood.

  • Called: dirname on nil
  • Error reported: close

So there’s a chance somewhere of protected call stacks latching onto a mistaken stack frame.

Typically such errors are sporadic, but this one was reliably reproducible on my machine, not sure about other machines. Though, also weirdly, you might need my specific audio file (not sure).

  1. Install the JITModular quark – but use git, and roll back to HEAD^ (because I already fixed my bug there).
  2. Launch SC.
  3. p = JITModPatch.new
  4. In the new code window, JITModPatch.current.addBuf(\buf, JMBuf.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav"));
  5. In the GUI window, click Save and choose a path + new filename.
  6. Error should happen here (with the wrong method selector) and nothing gets saved.

That threw me for about 20 minutes :laughing:

hjh