Skip to content

Commit

Permalink
Improved null check that also compile.
Browse files Browse the repository at this point in the history
  • Loading branch information
mawtex committed Sep 30, 2019
1 parent f9b0bd0 commit a5026f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Composite/C1Console/Actions/ActionLockingFacade.cs
Expand Up @@ -416,7 +416,10 @@ private static string GetLockKey(EntityToken entityToken)
if (entityToken is DataEntityToken)
{
var dataEntityToken = entityToken as DataEntityToken;
lockKey = lockKey + (dataEntityToken.DataSourceId.LocaleScope ?? "").ToString();
if (dataEntityToken.DataSourceId != null && dataEntityToken.DataSourceId.LocaleScope != null)

This comment has been minimized.

Copy link
@burningice2866

burningice2866 Oct 2, 2019

Contributor

@mawtex Can be simplified to if (dataEntityToken.DataSourceId?.LocaleScope != null)

{
lockKey = lockKey + dataEntityToken.DataSourceId.LocaleScope.ToString();
}
}

return lockKey;
Expand Down

0 comments on commit a5026f0

Please sign in to comment.