How to solve the problem that SyntaxEditor removes the same node multiple times? #54353
-
Hello, everyone, I don't know how to describe this scene, but I found this problem and can't solve it! var editor = new SyntaxEditor(root, new AdhocWorkspace());
editor.RemoveNode(root.Usings[3]);
editor.RemoveNode(root.Usings[3]);
var r = editor.GetChangedRoot(); //--> System.NullReferenceException:“Object reference not set to an instance of an object.” |
Beta Was this translation helpful? Give feedback.
Answered by
CyrusNajmabadi
Jun 24, 2021
Replies: 1 comment 1 reply
-
The editor api doesn't support removing the same node multiple times. Consider changing your code to not call |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
NMSAzulX
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The editor api doesn't support removing the same node multiple times. Consider changing your code to not call
editor.RemoveNode(root.Usings[3]);
twice.