Skip to content

Commit cb0ff1e

Browse files
committed
Fix Unity null propagation
1 parent e5cfded commit cb0ff1e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Assets/MixedRealityToolkit/Inspectors/Profiles/MixedRealityInputSystemProfileInspector.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,14 @@ protected override ServiceConfigurationProperties GetDataProviderConfigurationPr
211211
/// <inheritdoc/>
212212
protected override IMixedRealityServiceConfiguration GetDataProviderConfiguration(int index)
213213
{
214-
var configurations = (target as MixedRealityInputSystemProfile)?.DataProviderConfigurations;
215-
if (configurations != null && index >= 0 && index < configurations.Length)
214+
MixedRealityInputSystemProfile targetProfile = target as MixedRealityInputSystemProfile;
215+
if (targetProfile != null)
216216
{
217-
return configurations[index];
217+
var configurations = targetProfile.DataProviderConfigurations;
218+
if (configurations != null && index >= 0 && index < configurations.Length)
219+
{
220+
return configurations[index];
221+
}
218222
}
219223

220224
return null;

0 commit comments

Comments
 (0)