Skip to content
This repository has been archived by the owner on Apr 19, 2019. It is now read-only.

Put a check if wrapper is blank. #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

archergod
Copy link

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.

@GianlucaGuarini
Copy link
Owner

I think this should be enough:

if (!$img.length) return;

@archergod
Copy link
Author

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

@GianlucaGuarini
Copy link
Owner

$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?

@unbreak
Copy link

unbreak commented Jul 29, 2015

Why dont use:

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

?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants