From 72cb36c5f904ab40ecc90d29e5b74b7e022eedce Mon Sep 17 00:00:00 2001 From: Greg Pomerantz Date: Wed, 29 Jan 2020 09:13:02 -0500 Subject: [PATCH] app/internal/gpu: make the zero value of paint.ImageOp useful Do not panic when drawing the zero value of paint.ImageOp. Signed-off-by: Greg Pomerantz --- app/internal/gpu/gpu.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/internal/gpu/gpu.go b/app/internal/gpu/gpu.go index 3e208a68..54c4c12c 100644 --- a/app/internal/gpu/gpu.go +++ b/app/internal/gpu/gpu.go @@ -139,7 +139,7 @@ func decodeImageOp(data []byte, refs []interface{}) imageOpData { } handle := refs[1] if handle == nil { - panic("nil handle") + return imageOpData{} } return imageOpData{ src: refs[0].(*image.RGBA),