review some possible nil error panics (#20518)

Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-06-23 12:54:46 +03:00
коммит произвёл GitHub
родитель 00016e3a4f
Коммит 4b5d56a8c2
3 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@@ -58,7 +58,7 @@ func (p *MyPlugin) MessageWillBePosted(_ *plugin.Context, _ *model.Post) (*model
byteReader := bytes.NewReader(imageProfile)
img2, _, err2 := image.Decode(byteReader)
if err2 != nil {
return nil, err.Error()
return nil, err2.Error()
}
if img2.At(2, 3) != colorful {
return nil, fmt.Sprintf("color mismatch %v != %v", img2.At(2, 3), colorful)