ionic: check for NULL structs on teardown