Error processing slides with empty math element: Value cannot be null. (Parameter 'mathText')

Hi Aspose team,

We are observing errors processing certain PPTX files containing empty math elements. The files are valid OOXML packages, which implies this is a bug in Aspose.Slides 26.06.

System.ArgumentNullException
Value cannot be null. (Parameter 'mathText')
   at Aspose.Slides.MathText.MathematicalText..ctor(String mathText, IPortionFormat portionFormat)

I have two minimal repro cases involving empty OMML math text in PPTX files.

  1. Load failure with self-closing empty math text

The attached file aspose-load-selfclosing-empty-mathtext.pptx contains empty math text serialized as:

<m:t/>

Minimal code:

using Aspose.Slides;
using Aspose.Slides.Export;

using var presentation = new Presentation("aspose-load-selfclosing-empty-mathtext.pptx");
presentation.Save("out.pdf", SaveFormat.Pdf);

Actual result:

Aspose.Slides.PptxReadException
Value cannot be null. (Parameter 'mathText')
  1. InsertClone failure with explicit empty math text

The attached file aspose-insertclone-empty-mathtext.pptx loads successfully and contains empty math text serialized as:

<m:t></m:t>

Minimal code:

using Aspose.Slides;

using var source = new Presentation("aspose-insertclone-empty-mathtext.pptx");
using var destination = new Presentation();

destination.Slides.InsertClone(0, source.Slides[0]);

Actual result:

System.ArgumentNullException
Value cannot be null. (Parameter 'mathText')

Expected result for both cases: Aspose should tolerate empty OMML math text, or at least handle it without throwing a null mathText exception.

I attached a self-contained repro project. Run dotnet run from the folder to reproduce both failures.
aspose_math_repros.zip (670.8 KB)

We apologize for any inconvenience caused. We have reproduced the ArgumentNullException triggered by empty math elements in PPTX files with Aspose.Slides 26.6, as described in your examples. The issue has been logged and is currently being tracked for a fix.

Issue ID(s): SLIDESNET-45432