Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
fix #291 - CreateChangedEventCodeRefactoringProvider exception on aut…
Browse files Browse the repository at this point in the history
…o-implemented property (VB)
  • Loading branch information
siegfriedpammer committed Apr 7, 2017
1 parent 15454be commit 7273616
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte

var propertyBlock = property.Parent as PropertyBlockSyntax;

if (propertyBlock == null)
return;

var field = GetBackingField(model, propertyBlock);
if (field == null)
return;
Expand Down
13 changes: 12 additions & 1 deletion Tests/VB/CodeRefactorings/CreateChangedEventTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,17 @@ End Set
End Property
End Class");
}
}

[Fact]
public void TestIssue291()
{
TestWrongContext<CreateChangedEventCodeRefactoringProvider>(@"
Class TestClass
Dim _test As String
Public Property $Test As String
End Class");
}
}
}

0 comments on commit 7273616

Please sign in to comment.