SyntaxEditor.Text throws NullReference exception

SyntaxEditor for Windows Forms Forum

Posted 10 years ago by Santosh
Version: 4.0.0284
Platform: .NET 3.5
Environment: Windows Vista (32-bit)
Avatar
In the below code, the Syntax editor throws Nullreferences exception:

SyntaxEditor.Text= String.Empty;

Exception:
System.NullReferenceException was caught
Message="Object reference not set to an instance of an object."
Source="ActiproSoftware.SyntaxEditor.Net20"
StackTrace:
at ActiproSoftware.SyntaxEditor.SyntaxEditor.set_Text(String value)
at Yokogawa.IA.RPO.WF.BPMN.UI.controls.PortEditControl.ClearLogicalPortData() in G:\WorkFlow Composer\RPO1.02\Workflow\Source\BPMN\Yokogawa.IA.RPO.WF.BPMN.UI\Controls\PortEditControl.cs:line 701
InnerException:

This is coming so frequently, in some specific scenarios, it is throwing exception.
Please let me know how to handle this?

Thanks,
Santosh

[Modified at 03/18/2010 01:07 AM]

Comments (1)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Santosh,

The only way that could happen is if you are setting that property after the SyntaxEditor has been disposed, because there is no longer a Document reference and the Text property's setter just does:
document.Text = value;
We'll add a null ref check on document for the next version but you should look into why the Document has been nulled out, which is only likely if you are disposing the control then continuing to use it after, which is bad.


Actipro Software Support

The latest build of this product (v2020.1 build 0400) was released 9 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.