Skip to content

Commit

Permalink
fix(Input): check to make sure value is not null before attempting to…
Browse files Browse the repository at this point in the history
… clean it
  • Loading branch information
deanterm authored and benjamincharity committed Feb 21, 2020
1 parent c59d1c5 commit 788cfe3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion terminus-ui/input/src/input.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ export class TsInputComponent implements
}
// If the unmask regex is a function, invoke it to get the plain regex
const finalRegex: RegExp = isFunction(regex) ? regex() : regex;
return finalRegex ? value.replace(new RegExp(finalRegex), '') : value;
return finalRegex && value ? value.replace(new RegExp(finalRegex), '') : value;

}

Expand Down

0 comments on commit 788cfe3

Please sign in to comment.