jQuery.BlackAndWhite icon indicating copy to clipboard operation
jQuery.BlackAndWhite copied to clipboard

Put a check if wrapper is blank.

Open archergod opened this issue 9 years ago • 4 comments

In case the wrapper has no image tag, it was generating error and halting the rest of execution, with this patch it will by pass such blank wrapper.

archergod avatar Mar 26 '15 11:03 archergod

I think this should be enough:

if (!$img.length) return;

GianlucaGuarini avatar Mar 26 '15 12:03 GianlucaGuarini

well $img was coming as undefined so it will again generate the undefined error with that statement.

archergod avatar Mar 26 '15 13:03 archergod

$img can never be undefined it's a jquery selector instance that is always an array. Sure your problem is not somewhere else? Could you make a jsfiddle please?

GianlucaGuarini avatar Apr 02 '15 07:04 GianlucaGuarini

Why dont use:

$('.bwWrapper img').parent().BlackAndWhite...

?

unbreak avatar Jul 29 '15 07:07 unbreak