- Home /
How to make MonoDevelop to break when a MissingReferenceException occurs?
I have an script that creates and deletes objects, I also have a coroutine that makes changes on those objects over a period of time. In theory at least, it is not possible for an object to be deleted before the coroutine finishes with it...
Everything works fine during a variable period of time, however sporadically I'm getting a MissingReferenceException... mening 2 posibilites: 1) the object being processed in the coroutine was deleted... or 2) under some circumstances I'm passing a wrong value to the coroutine... The problem is I won't be able to tell unless I can make MonoDevelop to stop exactly when the exception occurs.
In the Exceptions window (accesible from Run/Exceptions...) I cannot see something like: "UnityEngine.MissingReferenceException" or "System.MissingReferenceException" or anything a like... so how do I tell it to stop on this particular exception???
The only other possibilty I see right now would be to test with a function that detects deleted objects or wrong references, but... does such function exist???
Answer by dougdodd · Nov 01, 2014 at 03:46 AM
Use a try/catch to isolate the occurrence and breakpoint in the catch to examine the situation in the Debugger.
Your answer
