Skip to content

Commit

Permalink
Merge pull request #394 from StefanMaron/development
Browse files Browse the repository at this point in the history
Resolve exception InvalidOperationException
  • Loading branch information
Arthurvdv authored Dec 1, 2023
2 parents cd7c1f9 + 5486dc3 commit f80a0fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Design/Rule0039PageRunTableMismatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ private void AnalyzeSetRecordArgument(OperationAnalysisContext ctx)

IOperation pageReference = ctx.Operation.DescendantsAndSelf().Where(x => x.GetSymbol() != null)
.Where(x => x.Type.GetNavTypeKindSafe() == NavTypeKind.Page)
.First();
.SingleOrDefault();
if (pageReference == null) return;
IVariableSymbol variableSymbol = (IVariableSymbol)pageReference.GetSymbol().OriginalDefinition;
IPageTypeSymbol pageTypeSymbol = (IPageTypeSymbol)variableSymbol.GetTypeSymbol().OriginalDefinition;
ITableTypeSymbol pageSourceTable = pageTypeSymbol.RelatedTable;
Expand Down

0 comments on commit f80a0fe

Please sign in to comment.