Add null check for ControlMainFrame Page