Fix broken dlg_val assigment when value is NULL.

(cherry picked from commit 2c7e33e67c82ce54addf97e558f5f8b8473bab19)