It should never be the case that an Overlay instance does not have an overlay jQuery element.
If this check is really necessary, than the above condition has been broken, and this could be done by someone nullifying ```overlay.$element```.