Fix crash in getDialogId() when the dialog is in NULL state, ie with to-tag not yet known.

Merged Simon Morlat requested to merge fix/fix_crash into master

Merge request reports