SyntaxEditor.Text throws NullReference exception

SyntaxEditor for Windows Forms Forum

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

SyntaxEditor.Text= String.Empty;

System.NullReferenceException was caught
Message="Object reference not set to an instance of an object."
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

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


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

Comments (1)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
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 (v24.1.0) was released 4 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.