Check for undefined message

Prevents empty javascript alert on save of datagrid popup dialog.