Handled a potential null reference