Minor patching

This commit is contained in:
abalabahaha
2016-02-02 05:59:55 -08:00
parent b7c1b6ebe6
commit 9173ded903
4 changed files with 8 additions and 10 deletions

View File

@@ -16,7 +16,7 @@ export default class Cache extends Array {
key = null;
} else if (key === this[discrimS] && typeof value === "string") {
return this[discrimCacheS][value] || null;
} else if (value.constructor.name === 'RegExp') {
} else if (value && value.constructor.name === 'RegExp') {
var valid = function valid(item) {
return value.test(item);
}
@@ -45,7 +45,7 @@ export default class Cache extends Array {
if (typeof key === 'function') {
var valid = key;
key = null;
} else if (value.constructor.name === 'RegExp') {
} else if (value && value.constructor.name === 'RegExp') {
var valid = function valid(item) {
return value.test(item);
}