Only assign if val is not null
Merge pull request #2 from AWinterman/master

Only assign if val is not null