Skip to content

Commit

Permalink
Return null when module is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Wender Lima committed Jun 12, 2015
1 parent 2812802 commit bd6664a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/angular-simple-mask.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ angular.module('angularMask', [])
});

function mask(val) {
if(val === null){
return '';
}
var value = String(val).replace(/\D/g,'');
if(arrFormat.length > 1){
for(var a in arrFormat){
Expand Down

0 comments on commit bd6664a

Please sign in to comment.