NullReferenceException Occurs when Ordering Presentation Shapes in C#

I am using Aspose.Slides.Net 23.4.0, and .net 8.
When I run the code

private IOrderedEnumerable<IShape> SortShapes(ShapeCollection shapes)
{
    var orderedShapes = shapes.OrderBy(s => s.Frame.Rectangle.X);

    return orderedShapes;
}

I encounter the following error:

( , , Iystem.NullReferenceException: Object reference not set to an instance of an object.
(S , , B atnt32 )
) attring , oolean, Int32 ,
a(, , , , , I
) tnt32 , Boolean , ,
a
t .(& , Boolean& )
() at
ac,
t tor(TextFrame , , IBaseSlide , )
at .( , )
at .( , Single , Single , )
at .()
at Aspose.Slides.Shape.get_Frame()

It seems that the error occurs when I try to get the attribute shape.Frame.Retangle.X. Could anyone gave me some advice to fix the error, please?
Thanks a lots.

@Rachel_Lee,
Thank you for contacting free support. We are sorry that you have to encounter this problem. Please share the following files and information:

  • sample presentation file (you can zip it and upload an archive file here)
  • OS version on which the code was executed

Then we will investigate the case and resolve the issue.

Hi @andrey.potapov ,
Thanks for the rapid reply. The error have resolved when I upgrade Aspose.Slide.Net to 24.1.0.

@Rachel_Lee,
We are glad that the issue has been resolved on your end. Thank you for using Aspose.Slides.