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

in case _getFiles got crash (in sprite.coffee) #11

Open
XenoRoot opened this issue Dec 10, 2014 · 0 comments
Open

in case _getFiles got crash (in sprite.coffee) #11

XenoRoot opened this issue Dec 10, 2014 · 0 comments

Comments

@XenoRoot
Copy link

I got an error when I was going to make spritesheet file. 'uncaught exception' occurred.
(can't remember exact condition)
In sprite.coffee file, '_getFiles' method made an error.

A simple 'if' check would protect it from error. Code goes below: (sprite.coffee)

104 104       _getFiles: (cb) ->
105 105         fs.readdir "#{@path}/#{@name}", (err, files) ->

106     -         files = files.filter (file) -> file.match /\.(png|gif|jpg|jpeg)$/
    106 +         if not err and files
    107 +           files = files.filter (file) -> file.match /\.(png|gif|jpg|jpeg)$/

107 108           cb err, files

Thanks for your contribution.

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

No branches or pull requests

1 participant