diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -14,9 +14,13 @@ module.exports = function (file, options) {
     var patternsToBeIgnored = config.ignores || [];
     var patternsToBeContained = config.contains || [];
 
-    ignoredFile = (helper.containsPatterns(file, patternsToBeIgnored) || ignoredFile);
+    if (patternsToBeIgnored.length) {
+        ignoredFile = (helper.containsPatterns(file, patternsToBeIgnored) || ignoredFile);
+    }
 
-    ignoredFile = (helper.doNotContainsPatterns(file, patternsToBeContained) || ignoredFile);
+    if (patternsToBeContained.length) {
+        ignoredFile = (helper.doNotContainsPatterns(file, patternsToBeContained) || ignoredFile);
+    }
 
     function write (buffer) {
         content += buffer;
[Andres Troiano] - Fix problems when contains or ignores are not provided