resolve defer early if there is no modal CLUB-1339
Ensure the defer/resolve handler is defined before calling closeModal
Merge pull request #1277 from onepercentclub/hotfix/enable-dd

Resolve defer early if there is no modal CLUB-1339