Only assign if val is not null