Check whether $el is defined at all.

Fixes a race-condition, whereby setPosition is called from the patterns-inject
event handler before the modal has been initialized.