Author Topic: PI-1.8 RC7 and 1054 - PI has access violation if script uses non existent view  (Read 2679 times)

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
The following code generates an access violation if the view does not exists (assuming the process exists). This is true for other processes also.

Code: [Select]
var processInstance = ProcessInstance.fromIcon("anACDNR");
Console.writeln("ProcessInstance " + processInstance);

var view = View.viewById("NONEXISTENTVIEW");
Console.writeln("view " + view);

// Access violation
result = processInstance.executeOn(view);

It is possible to test the view with isNull becore calling the process, but it would be much safer if the process did write an error message.
For example the same code with a non-existent process generates an error 'TypeError: processInstance is null'.

-- bitli


Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Hi Bitli,

Bug confirmed. It is now fixed, so this won't happen anymore in the next release (an appropriate exception will be thrown if you call Instance.executeOn() for a null view).

Thank you for detecting this problem.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/