NullReferenceException at ParameterInfoSession.OnOpened

SyntaxEditor for WPF Forum

Posted 5 years ago by Dirk Zellerfeld
Version: 19.1.0681
Platform: .NET 3.0 (Core)
Environment: Windows 10 (64-bit)

I receive the following exception:

  Message=Object reference not set to an instance of an object.
   at ActiproSoftware.Windows.Controls.SyntaxEditor.IntelliPrompt.Implementation.ParameterInfoSession.OnOpened(EventArgs e)
   at ActiproSoftware.Windows.Controls.SyntaxEditor.IntelliPrompt.Implementation.IntelliPromptSessionBase.Open(IEditorView view, TextRange textRange)

at the following code:

if (Session.Items.Count == 0) return false;
Session.Open(view, new TextRange(context.ArgumentListOffset));

The session items count is 2. The context.ArgumentListOffset is 13. The view is not null. This exception is ONLY thrown when I place a breakpoint at the first line in the RequestSession function and then step through the function. Without stepping through (but debugger attached) no exception is thrown but also no parameter popup is shown. Nothing happens at all. This gets even more weird when I click on the "Edit -> Intelliprompt -> Parameter Info" menu item because then the parameter popup is shown.

So all three ways behave completely different although the same code is executed. I've tried to create a demonstration project but failed as it works fine there as far as I can tell.

Thanks to resharper I found the exception above is thrown at this line in OnOpened():

this.View.SyntaxEditor.ElementTransparencyManager.\u00239zk(this.\u0023z5b.Child, this.ControlKeyDownOpacity);

According to VS this.View is null at time of exception is thrown. I can step through the source thanks to Resharper and found that after this line is executed:

this.\u0023z5b.IsOpen = true;

this.View is set to NULL. Hope it helps.

[Modified 5 years ago]

Comments (1)

Answer - Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Dirk,

Thanks for reporting this.  It seems that the breakpoint and debugger step through might be causing the popup to close earlier than it normally would, and between places where we already did null checks.  We have updated our code that should fix this for the upcoming maintenance release.

Actipro Software Support

The latest build of this product (v24.1.2) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.