Fix escape key when no reveal is shown

If you try to press escape key when no reveal modal is shown; an error is thrown. Fixed.
Merge pull request #3872 from Extaze/fix-reveal-close-on-esc

Fix escape key when no reveal is shown