浏览代码

Guard against a potential null dereference

jvoisin 1 年之前
父节点
当前提交
abfd9306a4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      internal/reader/icon/finder.go

+ 1 - 1
internal/reader/icon/finder.go

@@ -222,7 +222,7 @@ func resizeIcon(icon *model.Icon) *model.Icon {
 	case "image/gif":
 		src, err = gif.Decode(r)
 	}
-	if err != nil {
+	if err != nil || src == nil {
 		slog.Warn("unable to decode the icon", slog.Any("error", err))
 		return icon
 	}