Check if view is null in getTopParent
Modified how getTopParent() works
Make ViewParent final in getTopParent()