@@ -488,12 +488,13 @@ private static void PatchAddresses(this Core2EnterpriseUser user, PatchOperation
488
488
489
489
if
490
490
(
491
- string . IsNullOrWhiteSpace ( address . Country )
491
+ address == null ||
492
+ ( string . IsNullOrWhiteSpace ( address . Country )
492
493
&& string . IsNullOrWhiteSpace ( address . Locality )
493
494
&& string . IsNullOrWhiteSpace ( address . PostalCode )
494
495
&& string . IsNullOrWhiteSpace ( address . Region )
495
496
&& string . IsNullOrWhiteSpace ( address . StreetAddress )
496
- && string . IsNullOrWhiteSpace ( address . Formatted )
497
+ && string . IsNullOrWhiteSpace ( address . Formatted ) )
497
498
)
498
499
{
499
500
if ( addressExisting != null )
@@ -951,19 +952,23 @@ private static void PatchPhoneNumbers(this Core2EnterpriseUser user, PatchOperat
951
952
} ;
952
953
}
953
954
954
- string value = operation . Value ? . Single ( ) . Value ;
955
- if
956
- (
957
- value != null
958
- && OperationName . Remove == operation . Name
959
- && string . Equals ( value , phoneNumber . Value , StringComparison . OrdinalIgnoreCase )
960
- )
955
+ if ( phoneNumber != null )
961
956
{
962
- value = null ;
957
+ string value = operation . Value ? . Single ( ) . Value ;
958
+ if
959
+ (
960
+ value != null
961
+ && OperationName . Remove == operation . Name
962
+ && string . Equals ( value , phoneNumber . Value , StringComparison . OrdinalIgnoreCase )
963
+ )
964
+ {
965
+ value = null ;
966
+ }
967
+
968
+ phoneNumber . Value = value ;
963
969
}
964
- phoneNumber . Value = value ;
965
970
966
- if ( string . IsNullOrWhiteSpace ( phoneNumber . Value ) )
971
+ if ( phoneNumber == null || string . IsNullOrWhiteSpace ( phoneNumber . Value ) )
967
972
{
968
973
if ( phoneNumberExisting != null )
969
974
{
0 commit comments