diff --git a/canvas/texture.go b/canvas/texture.go index d529379..da1b900 100644 --- a/canvas/texture.go +++ b/canvas/texture.go @@ -95,6 +95,9 @@ func (this *Texture) Clip (bounds image.Rectangle) canvas.Texture { // AssertTexture checks if a given canvas.Texture is a texture from this package. func AssertTexture (unknown canvas.Texture) *Texture { + if unknown == nil { + return nil + } if tx, ok := unknown.(*Texture); ok { return tx } else {