Skip to content

Commit

Permalink
Minor change - use null propagation to tidy up a few lines of code.
Browse files Browse the repository at this point in the history
  • Loading branch information
whiskeyjay committed May 20, 2016
1 parent fbc4be1 commit ee17176
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions AzureFunctions/EventHubsToElastic/run.csx
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ private static async Task EnsureIndexExists(string currentIndexName, ElasticClie

if (!createIndexResult.IsValid)
{
if (createIndexResult.ServerError != null &&
createIndexResult.ServerError.Error != null &&
string.Equals(createIndexResult.ServerError.Error.Type, "IndexAlreadyExistsException", StringComparison.OrdinalIgnoreCase))
if (string.Equals(createIndexResult.ServerError?.Error?.Type, "IndexAlreadyExistsException", StringComparison.OrdinalIgnoreCase))
{
// This is fine, someone just beat us to create a new index.
return;
Expand Down

0 comments on commit ee17176

Please sign in to comment.