If the whiteList option is not set, shouldn't the function return false for all files? It seems we should move "return true" to inside if(whitelist) block and then still have "return false" here.