Added null check to updatePatient.