Skip to content

Commit

Permalink
Resolve exception InvalidOperationException
Browse files Browse the repository at this point in the history
Arthurvdv committed Dec 1, 2023

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent 110de49 commit 5486dc3
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
@@ -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;

0 comments on commit 5486dc3

Please sign in to comment.