matthewyarlett / AngularJS-Directive-for-SharePoint-People-Picker

An AngularJS directive that wraps up the Microsoft Client-side people picker
http://matthewyarlett.blogspot.com/2015/04/using-microsoft-client-side-people.html
9 stars 12 forks source link

If the control is empty when loaded a null reference exception is thrown #1

Closed colinrippey closed 8 years ago

colinrippey commented 9 years ago

Line 110:

              userModel = ngModel[0].$modelValue;                                       

This line will set userModel to null if the control has no value.

Line 118:

                 for(var b = 0; b < userModel.length; b++){

This line will throw a null reference exception as userModel is null.

matthewyarlett commented 8 years ago

Just updated the directive. It handles empty models now.