Fixed input undefined error

I ran into the issue described here https://github.com/goodeggs/angular-nl2br/issues/1

I just added a check for undefined input and the correspnding test. Feel free to merge this if it fits for you :-)