[Fixes #3] Check if parent is null before invalidating appbar