Check if fragment is added before dealing with reference clicks

Bug: 69415
Change-Id: I7fc2f42daa134945063bc04ffdc0c1fba80609ce