From f1d971268eb1f099c500d93e6cc91303abfc0862 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 7 Nov 2019 21:08:01 +0100 Subject: [PATCH] op/paint: guard against nil image in ImageOp.Size Signed-off-by: Elias Naur --- op/paint/paint.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/op/paint/paint.go b/op/paint/paint.go index b15a716f..c0ce8791 100644 --- a/op/paint/paint.go +++ b/op/paint/paint.go @@ -67,6 +67,9 @@ func NewImageOp(src image.Image) ImageOp { } func (i ImageOp) Size() image.Point { + if i.src == nil { + return image.Point{} + } return i.src.Bounds().Size() }