Skip to content

Commit

Permalink
fixes #5761
Browse files Browse the repository at this point in the history
  • Loading branch information
retailcoder committed May 5, 2021
1 parent 0dd152c commit 5f9e653
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -54,6 +54,7 @@ protected override void OnExecute(object parameter)
{
var node = parameter as ICodeExplorerNode;
var declaration = parameter as Declaration;
var reference = parameter as CodeExplorerReferenceViewModel;

if (_state.Status != ParserState.Ready || node == null && declaration == null)
{
Expand All @@ -67,13 +68,13 @@ protected override void OnExecute(object parameter)
return;
}

if (!(node.Parent.Declaration is ProjectDeclaration))
if (reference != null && !(node.Parent.Declaration is ProjectDeclaration))
{
Logger.Error($"The specified ICodeExplorerNode expected to be a direct child of a node whose declaration is a ProjectDeclaration.");
return;
}

if (node.Parent?.Declaration is ProjectDeclaration projectDeclaration && node is CodeExplorerReferenceViewModel reference)
if (node.Parent?.Declaration is ProjectDeclaration projectDeclaration && reference != null)
{
if (!(reference.Reference is ReferenceModel model))
{
Expand Down

0 comments on commit 5f9e653

Please sign in to comment.