mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-05 03:23:50 +08:00
fix ocr panic.
This commit is contained in:
parent
b3233e604e
commit
ad8bcb63aa
@ -1009,6 +1009,9 @@ func decodeImageOcrResponse(_ *QQClient, _ uint16, payload []byte) (interface{},
|
|||||||
if rsp.Wording != "" {
|
if rsp.Wording != "" {
|
||||||
return nil, errors.New(rsp.Wording)
|
return nil, errors.New(rsp.Wording)
|
||||||
}
|
}
|
||||||
|
if rsp.RetCode != 0 {
|
||||||
|
return nil, errors.New(fmt.Sprintf("server error, code: %v msg: %v", rsp.RetCode, rsp.ErrMsg))
|
||||||
|
}
|
||||||
var texts []*TextDetection
|
var texts []*TextDetection
|
||||||
for _, text := range rsp.OcrRspBody.TextDetections {
|
for _, text := range rsp.OcrRspBody.TextDetections {
|
||||||
var points []*Coordinate
|
var points []*Coordinate
|
||||||
|
Loading…
x
Reference in New Issue
Block a user