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,7 +240,13 @@ is
Item : in Animation_view) Item : in Animation_view)
is is
begin begin
if Item = null
then
Boolean'write (Stream, False);
else
Boolean'write (Stream, True);
Animation'output (Stream, Item.all); Animation'output (Stream, Item.all);
end if;
end write; end write;
@@ -248,8 +254,16 @@ is
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
Boolean'read (Stream, Item_not_null);
if Item_not_null
then
Item := new Animation' (Animation'Input (Stream)); Item := new Animation' (Animation'Input (Stream));
else
Item := null;
end if;
end read; end read;