From d98ed8078dc37e0951a97cdd6cd1ff1739367568 Mon Sep 17 00:00:00 2001 From: Bert Jansen Date: Thu, 2 Dec 2021 18:23:36 +0100 Subject: [PATCH] Merge of #541. Thanks @magarma --- src/lib/CHANGELOG.md | 1 + .../ObjectHandlers/Utilities/ListItemUtilities.cs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/CHANGELOG.md b/src/lib/CHANGELOG.md index afb7b667f..407553b82 100644 --- a/src/lib/CHANGELOG.md +++ b/src/lib/CHANGELOG.md @@ -30,6 +30,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixing issue when trying to export datarow for list instances #531 [magarma - Miguel Angel García Martínez] - Fix issues exporting channels and tabs with TeamsAppId and Description #532 [magarma - Miguel Angel García Martínez] - Changed the property we get when exporting Teams apps #533 [magarma - Miguel Angel García Martínez] +- Fix for Null Exception when trying to set a term value in a file, listItem, and the term label contains a comma #541 [magarma - Miguel Angel García Martínez] ## [1.7.0] diff --git a/src/lib/PnP.Framework/Provisioning/ObjectHandlers/Utilities/ListItemUtilities.cs b/src/lib/PnP.Framework/Provisioning/ObjectHandlers/Utilities/ListItemUtilities.cs index aa692f1b4..35807e5c9 100644 --- a/src/lib/PnP.Framework/Provisioning/ObjectHandlers/Utilities/ListItemUtilities.cs +++ b/src/lib/PnP.Framework/Provisioning/ObjectHandlers/Utilities/ListItemUtilities.cs @@ -420,8 +420,10 @@ public static void UpdateListItem(ListItem item, TokenParser parser, IDictionary clonedContext.Load(taxonomyItem); clonedContext.ExecuteQueryRetry(); } - if (taxonomyItem!=null) + if (taxonomyItem != null) + { terms.Add(new KeyValuePair(taxonomyItem.Id, taxonomyItem.Name)); + } } TaxonomyField taxField = context.CastTo(field);