opengl.texture_set.stream: Handle case where 'Animation_view' is null.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user