jacobdufault / fullinspector

Full Inspector supercharges Unity's inspector
MIT License
111 stars 27 forks source link

fix FI exception when acessing destroyed object #193

Closed SugoiDev closed 7 years ago

SugoiDev commented 7 years ago

When destroying an object with DestroyImmediate programmatically, an exception will occur because FI will try to access the destroyed object. This PR fixes that.

There are probably other spots in the LateBindings where a null check could be useful, but I haven't reached any other yet.

An example where this will occur is in a toolkit editor with something like this

new tk.Button(
    new fiGUIContent("Remove"),
    (o, c) => DestroyImmediate(this)
)
SugoiDev commented 7 years ago

A trivial merge will be needed to have both this and #194

jacobdufault commented 7 years ago

Thanks!