crispincooper

ArcMap crashes if toolvalidator reads parameter value of nonexistant featurelayer

Discussion created by crispincooper on Sep 8, 2011
Latest reply on Nov 3, 2011 by crispincooper
This is an update on thread http://forums.arcgis.com/threads/38134-checking-for-existence-of-input-data-in-toolvalidator-crashes-arcmap?p=128903#post128903 started as a new thread as I have diagnosed the issue better.

ArcMap seems to crash in the following situation.

1. create a tool with the first and only parameter being a FeatureLayer
2. in the toolvalidator/updateParameters, try to read the value
  def updateParameters(self):
    x = self.params[0].value
    return

3. open the tool dialog to run the tool.  enter the name of some nonexistant data set or layer e.g. "sdlfkjdslfkjsdl"
4.arcmap crashes

Is there a way to prevent this?  I'd rather not inconvenience the users of my tool with this crash.

I just submitted an auto bug report from the crash.

Outcomes