Added check for null value in render function (ngModel viewValue)