Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MMCQ.quantize(...) can return false or undefined thus breaking the application. #54

Closed
mhahmadi opened this issue Feb 15, 2015 · 1 comment · Fixed by #55
Closed

MMCQ.quantize(...) can return false or undefined thus breaking the application. #54

mhahmadi opened this issue Feb 15, 2015 · 1 comment · Fixed by #55

Comments

@mhahmadi
Copy link
Contributor

cmap can become false or undefined after the following statement causing cmap.palette() in the next line to throw an error.

var cmap = MMCQ.quantize(pixelArray, colorCount);

it can be prevented with the following check and perhaps the return value can be null in such situation:

var cmap = MMCQ.quantize(pixelArray, colorCount);
var palette = cmap? cmap.palette() : null;
mhahmadi added a commit to mhahmadi/color-thief that referenced this issue Feb 15, 2015
Signed-off-by: Mohamad Ahmadi <mohamadhasan.ahmadi@gmail.com>
mhahmadi added a commit to mhahmadi/color-thief that referenced this issue Feb 15, 2015
Signed-off-by: Mohamad Ahmadi <mohamadhasan.ahmadi@gmail.com>
@mhahmadi mhahmadi mentioned this issue Feb 15, 2015
@lokesh
Copy link
Owner

lokesh commented Jun 30, 2015

#55 merged. Thanks again.

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

Successfully merging a pull request may close this issue.

2 participants