Permalink
Browse files

null check

  • Loading branch information...
1 parent 5ea330f commit df02033f44b5e33efdc84caef38b5cdc3018c408 @sujal committed Jun 15, 2013
Showing with 5 additions and 2 deletions.
  1. +3 −1 lib/image_headers.js
  2. +2 −1 src/image_headers.coffee
@@ -277,7 +277,9 @@
ImageHeaders.prototype.reset_buffer_data = function() {
this.buffer_index = 0;
- return this.buffer.slice();
+ if ((this.buffer != null)) {
+ return this.buffer.slice();
+ }
};
ImageHeaders.prototype.end_parsing = function() {
@@ -256,7 +256,8 @@ class ImageHeaders
reset_buffer_data: () ->
@buffer_index = 0
- @buffer.slice()
+ if (@buffer?)
+ @buffer.slice()
end_parsing: () ->
@reset_buffer_data()

0 comments on commit df02033

Please sign in to comment.