Added extra null check for the view result object