Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Error inside try{} statement (script)

  • Error inside try{} statement (script)

    Posted by Ben Rollason on February 12, 2010 at 11:27 am

    Hi there,

    I’m getting a weird error in a script… (not an expression)

    I’m using a try{} catch(error){} statement to test the value of a property that may or may not exist and to avoid a long loop through all properties of all layers testing for its existence.

    However, After Effects is giving me an error at a line inside the try{} statement. “Null is not an object”. The error is not the problem though. The object in question will often be null, that’s exactly why I’m using a try statement, to catch the error when it happens. I’m just a bit perplexed as to why the try statement isn’t catching the error. If I stop the script and run it for a second time, there are no errors and everything works exactly as expected. This happens in CS3 and CS4 and is totally repeatable. Open project -> run script -> error. Run script again -> no error.

    Has anyone else experienced anything similar and / or found a solution?

    Thanks.

    Ben.

    http://www.benrollason.com

    Dan Ebberts replied 16 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    February 12, 2010 at 3:17 pm

    My experience has been that try/catch doesn’t catch everything, but I don’t think I’ve encountered your situtation where it doesn’t behave the same on subsequent runs. Sounds like it might be a bug.

    Dan

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy