From 2b300b48b773bf65a94b8c4e282f517f2d1b6ca6 Mon Sep 17 00:00:00 2001 From: faiface Date: Wed, 25 Jan 2017 19:57:42 +0100 Subject: [PATCH] fix Sprite.SetPicture once again --- graphics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics.go b/graphics.go index ee14c96..106d870 100644 --- a/graphics.go +++ b/graphics.go @@ -187,7 +187,7 @@ func NewSprite(pic *Picture) *Sprite { func (s *Sprite) SetPicture(pic *Picture) { oldPic := s.pic s.pic = pic - if oldPic.Bounds().Size == pic.Bounds().Size { + if oldPic != nil && oldPic.Bounds().Size == pic.Bounds().Size { return } w, h := pic.Bounds().Size.XY()