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)
is
begin
if Item = null
then
Boolean'write (Stream, False);
else
Boolean'write (Stream, True);
Animation'output (Stream, Item.all);
end if;
end write;
@@ -248,8 +254,16 @@ is
procedure read (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Item : out Animation_view)
is
Item_not_null : Boolean;
begin
Boolean'read (Stream, Item_not_null);
if Item_not_null
then
Item := new Animation' (Animation'Input (Stream));
else
Item := null;
end if;
end read;