Error on calling ProcessSegmentPairs

Hi,

I'm trying the manipulate segments with ProcessSegmentPairs, but I always get the following exception in Studio 2015 12.0.4996.3:

System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
at Sdl.TranslationStudio.Editor.AbstractActiveRangeAction.IsActionEnabled()
at Sdl.TranslationStudio.Api.Editor.AbstractActiveDocumentAction.UpdateAction()
at Sdl.TranslationStudio.Editor.AbstractActiveRangeAction.sideBySideEditor_Target_Entered(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnGotFocus(EventArgs e)
at System.Windows.Forms.Control.WmSetFocus(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

And then immediately another one:

System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

at Sdl.TranslationStudioAutomation.IntegrationApi.Document.ProcessSegment(String processingName, ISegmentContainerNode segmentContainerNode, Action`2 process)
at Sdl.TranslationStudioAutomation.IntegrationApi.Document.ProcessSegmentPairs(String processingName, Action`2 process)
at Kaleidoscope.SmartQuery.Plugin.Utility.SmartQueryDataHandlerV2.SavePostedQueryInformation(Int32 queryId)

This is all I try to do at the moment:

if (editorController != null && editorController.ActiveDocument != null)
editorController.ActiveDocument.ProcessSegmentPairs(SmartDataTagOperationName, (pair, args) =>
{
});

The strange is that the same works in Studio2014. Can you please help?

thanks,

Tamas

Parents Reply
  • Hi,

    I tried e.g. with SamplePhotoPrinter.doc.sdlxliff, and TryPerfectMatch.doc.sdlxliff in the sample project.
    I tried it on an elder installation as well: 12.0.4809.0 => It did not crash!!! Then I upgraded to 12.0.4996.3 => And it crashes here too.

    It is a simple button on the ribbon, the handler does only this:

    protected override void Execute()
    {
    var editorController = SdlTradosStudio.Application.GetController<EditorController>();
    if (editorController?.ActiveDocument != null)
    {
    editorController.ActiveDocument.ProcessSegmentPairs("TEST", (pair, args) =>
    {

    });
    }
    }

    thanks,
    Tamas
Children
No Data