-
Error inside try{} statement (script)
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.