opengl.texture_set.stream: Handle case where 'Animation_view' is null.

This commit is contained in:
Rod Kay
2024-09-24 16:13:59 +10:00
parent a690050568
commit 5360507248

View File

@@ -240,16 +240,30 @@ is
Item : in Animation_view) Item : in Animation_view)
is is
begin begin
Animation'output (Stream, Item.all); if Item = null
then
Boolean'write (Stream, False);
else
Boolean'write (Stream, True);
Animation'output (Stream, Item.all);
end if;
end write; end write;
procedure read (Stream : not null access Ada.Streams.Root_Stream_Type'Class; procedure read (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Item : out Animation_view) Item : out Animation_view)
is is
Item_not_null : Boolean;
begin begin
Item := new Animation' (Animation'Input (Stream)); Boolean'read (Stream, Item_not_null);
if Item_not_null
then
Item := new Animation' (Animation'Input (Stream));
else
Item := null;
end if;
end read; end read;