Skip to content

Commit

Permalink
Fix: Ensure isVinyl always returns a boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
erikkemperman authored and phated committed Sep 27, 2016
1 parent b3de115 commit afbbb05
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ File.prototype.inspect = function() {
};

File.isVinyl = function(file) {
return file && file._isVinyl === true;
return (file && file._isVinyl === true) || false;
};

// Virtual attributes
Expand Down
2 changes: 1 addition & 1 deletion test/File.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('File', function() {
done();
});
it('should return false on a null object', function(done) {
File.isVinyl({}).should.equal(false);
File.isVinyl(null).should.equal(false);
done();
});
});
Expand Down

0 comments on commit afbbb05

Please sign in to comment.