Click on document does not close the selectbox

Jquery version 1.10.4. Click on body does not close the select box.
The problem is here https://github.com/roblaplaca/jQuery-Custom-Selectbox/blob/master/js/SelectBox.js#L28
if element has not this parents, `$(e.target).parents(".customSelect").get(0)` equals `undefined` instead of `null`.
This is the most optimal solution i know.