Skip to content

Commit 3a94f17

Browse files
committed
Fix NULL reference
1 parent 21ad4f0 commit 3a94f17

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

src/Umbraco.Cms.Integrations.Crm.Dynamics/Services/DynamicsService.cs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,23 +133,30 @@ public async Task<IEnumerable<FormDto>> GetForms(DynamicsModule module)
133133
if (module.HasFlag(DynamicsModule.Outbound))
134134
{
135135
var forms = await Get<OutboundFormDto>(oauthConfiguration.AccessToken, Constants.Modules.OutboundPath);
136-
list.AddRange(forms.Value.Select(p => new FormDto
136+
137+
if (forms != null && forms.Value != null && forms.Value.Any())
137138
{
138-
Id = p.Id,
139-
Name = p.Name,
140-
Module = DynamicsModule.Outbound
141-
}));
139+
list.AddRange(forms.Value.Select(p => new FormDto
140+
{
141+
Id = p.Id,
142+
Name = p.Name,
143+
Module = DynamicsModule.Outbound
144+
}));
145+
}
142146
}
143147

144148
if (module.HasFlag(DynamicsModule.RealTime))
145149
{
146150
var forms = await Get<RealTimeFormDto>(oauthConfiguration.AccessToken, Constants.Modules.RealTimePath);
147-
list.AddRange(forms.Value.Select(p => new FormDto
151+
if (forms != null && forms.Value != null && forms.Value.Any())
148152
{
149-
Id = p.Id,
150-
Name = p.Name,
151-
Module = DynamicsModule.RealTime
152-
}));
153+
list.AddRange(forms.Value.Select(p => new FormDto
154+
{
155+
Id = p.Id,
156+
Name = p.Name,
157+
Module = DynamicsModule.RealTime
158+
}));
159+
}
153160
}
154161

155162
return list;

src/Umbraco.Cms.Integrations.Crm.Dynamics/Umbraco.Cms.Integrations.Crm.Dynamics.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PackageIconUrl></PackageIconUrl>
1111
<PackageProjectUrl>https://github.com/umbraco/Umbraco.Cms.Integrations/blob/main/src/Umbraco.Cms.Integrations.Crm.Dynamics</PackageProjectUrl>
1212
<RepositoryUrl>https://github.com/umbraco/Umbraco.Cms.Integrations</RepositoryUrl>
13-
<Version>1.3.3</Version>
13+
<Version>1.3.4</Version>
1414
<Authors>Umbraco HQ</Authors>
1515
<Company>Umbraco</Company>
1616
<PackageTags>Umbraco;Umbraco-Marketplace</PackageTags>

0 commit comments

Comments
 (0)