Added a sanity check in AspectTreeModel to avoid potential crashes.

Authored by asemke on Jun 9 2018, 7:31 PM.