Challenge with Batch Task API and ISegmentPair.Properties.TranslationOrigin

Dear community,

we would like to create a custom word count batch task. Now we have the challenge that when the custom batch task runs before the SDLXLIFFs have been opened the first time, we get an error “object not set to an instance”, because “segmentPair.Properties.TranslationOrigin” is null while we are trying to access its property “OriginType”. However, after the the SDLXLIFFs have been opened once, the custom report is created successfully.

 

public override void TaskComplete()

        {

            foreach (ISegmentPair segmentPair in segmentPairExtractor.segmentPairs)

            {

                if (segmentPair.Properties.TranslationOrigin.OriginType == null)

 

, can you maybe help?

 

Best wishes,

Simon