Skip to content

关于fortune运势插件报错生成空文件的一个问题 #593

Closed
@byx2020

Description

@byx2020

昨天将zbp从1.6.0-beta1更新到1.6.2-beta4之后,
发现fortune运势插件在被通过指令触发生成图片时较大概率会出现如下所示的报错,

�[0m�[33m[WARNING] [file]文件 data/Fortune/全部混合.zip 存在, 已跳过md5检查
�[0m�[31m[ERROR] [bot] execute handler err: interface conversion: interface {} is nil, not
 []uint8
goroutine 98742 [running]:
runtime/debug.Stack()
        C:/Program Files/Go/src/runtime/debug/stack.go:24 +0x65
github.com/wdvxdr1123/ZeroBot.match.func2.1.1()
        C:/Users/Administrator/go/pkg/mod/github.com/wdvxdr1123/[email protected]/bot.go:24
9 +0x45
panic({0xcf2f20, 0xc001468030})
        C:/Program Files/Go/src/runtime/panic.go:884 +0x213
github.com/FloatTech/ZeroBot-Plugin/plugin/fortune.init.0.func3.1()
        C:/Software/ZeroBot/ZeroBot/plugin/fortune/fortune.go:151 +0x185
github.com/FloatTech/zbputils/img/pool.SendImageFromPool({0xc00141a880?, 0xdb70e0?}, {0xc0
0141a880, 0x33}, 0xc001441f38, 0xc0012403b0, 0xc001240470)
        C:/Users/Administrator/go/pkg/mod/github.com/!float!tech/[email protected]
5092613-4a7ebf458f16/img/pool/sender.go:20 +0x111
github.com/FloatTech/ZeroBot-Plugin/plugin/fortune.init.0.func3(0xc00127f680)
        C:/Software/ZeroBot/ZeroBot/plugin/fortune/fortune.go:146 +0x7e7
github.com/wdvxdr1123/ZeroBot.match.func2.1()
        C:/Users/Administrator/go/pkg/mod/github.com/wdvxdr1123/[email protected]/bot.go:25
2 +0x68
created by github.com/wdvxdr1123/ZeroBot.match.func2
        C:/Users/Administrator/go/pkg/mod/github.com/wdvxdr1123/[email protected]/bot.go:24
5 +0xaa

同时会在“data\fortune\cache”目录下面生成一个如下图所示的空文件

image

但有一个奇怪的点是,也不是所有的生成都会出错,偶尔还是有正常生成并发送的(比如上图空文件下面的就是正常生成的文件),

简单看了一下报错内容,似乎是接口转换出了问题,但我能力有限也不知道应该如何解决,

自行尝试了修改调试多次无果之后,只好来这里打扰一下大佬,导致这个问题可能的原因会是什么,应该如何进行修复处理?

(关于“data/Fortune/全部混合.zip”这个文件,就是简单将所有类型的运势底图全部打包到了一个zip里面,而且我也测试过其他单独类型的运势底图,也是会出现上面相同的报错,因此我个人初步排除掉了“data/Fortune/全部混合.zip”文件导致此问题的可能性,至于“plugin\fortune\fortune.go”文件,我仅仅只是增加了全部混合这一个底图类型并将其设置为默认类型,其他代码都没有任何改动,这两个操作在1.6.0-beta1版本里面是可以正常使用的,就是不知道在1.6.2-beta4上为什么出问题了)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions