When running our unit test suite, we get the following error on every second run
NullReferenceException Object reference not set to an instance of an object.
at \x05 .get_KeepTextFlat()
at Aspose.Slides.TextFrameFormat.get_KeepTextFlat()
at \x06 .\x02(ITextFrame \x02, \x06 \x03, \x08 \x05)
at \x06 .\x02(ITextFrame \x02, \x02 \x03, \x08 \x05)
at \x0f .\x02(IAutoShape \x02, \x03 \x03, \x05 \x05, \x0f \x08)
at \x02 .\x02(IShape \x02, \x06 \x03, \x05 \x05, \x0f \x08)
at \x02 .\x02(IGroupShape \x02, \x06 \x03, \x05 \x05, \x0f \x08)
at \x08 .\x02(IBaseSlide \x02, \x0f \x03, \x05 \x05)
at \x05 .\x02(ILayoutSlide \x02, \x0e \x03, \x05 \x05)
at \x08 .\x02(ILayoutSlide \x02)
at \x06 .\x02(\x0e \x02, ILayoutSlide \x03, \x05 \x05, \x08 \x08)
at \x06 .\x02(\x0e \x02, IMasterSlide \x03, Boolean \x05, \x08 \x08)
at \x06 .\x02(IPresentation \x02, Stream \x03, PresentationTypeEx \x05, IPptxOptions \x08, InterruptionToken \x06)
at Aspose.Slides.Presentation.\x02(Stream \x02, PresentationTypeEx \x03, IPptxOptions \x05)
at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format, ISaveOptions options)
at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format)
at [Calling code...]
The following is a simplified version of what we are doing. We are basically splitting a presentation into separate presentations for each slide.
public void Save(ISlide original)
{
using var slidePres = new Presentation(new LoadOptions
{
BlobManagementOptions = new BlobManagementOptions
{
IsTemporaryFilesAllowed = false
}
});
slidePres.Slides.First().Remove();
slidePres.SlideSize.SetSize(960, 540, SlideSizeScaleType.EnsureFit);
slidePres.Slides.AddClone(original);
using var contentStream = File.OpenWrite("SomePath.pptx");
slidePres.Save(contentStream, SaveFormat.Pptx);
}
This is the original presentation that we are using in the tests
SingleSlide.7z (24.0 KB)