Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

完猜单词的时候出现空指针报警 #197

Closed
zyxdtk opened this issue Apr 18, 2022 · 3 comments
Closed

完猜单词的时候出现空指针报警 #197

zyxdtk opened this issue Apr 18, 2022 · 3 comments

Comments

@zyxdtk
Copy link

zyxdtk commented Apr 18, 2022

在centos8上自行编译的。可以执行"讲个笑话"这样的插件。但是一旦用”个人猜单词“功能就会报错
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x70b8ff]

goroutine 16 [running]:
github.com/fumiama/go-registry.(*Regedit).Get(0xc0000a6500, {0xc0000b0000?, 0x0?})
github.com/fumiama/go-registry@v0.1.5/reg.go:96 +0x13f
github.com/FloatTech/zbputils/file.GetLazyData({0xc0000b0000, 0x17}, 0x1, 0x1)
github.com/FloatTech/zbputils@v1.3.3-0.20220417132003-a50e9afdc0c6/file/updater.go:71 +0x368
github.com/zyxdtk/ZeroBot-Plugin/plugin/wordle.init.0.func3.1(0xc000340fc0?)
github.com/zyxdtk/ZeroBot-Plugin/plugin/wordle/wordle.go:89 +0x106
created by github.com/zyxdtk/ZeroBot-Plugin/plugin/wordle.init.0.func3
github.com/zyxdtk/ZeroBot-Plugin/plugin/wordle/wordle.go:87 +0x18c

@guohuiyuan
Copy link
Contributor

有没有一种可能,文件没下载下来

@zyxdtk
Copy link
Author

zyxdtk commented Apr 18, 2022

文件没下载下来是指?
打印了对应的文件
log.Infoln("[猜单词] ", fmt.Sprintf("%scet-4_%d.txt", en.DataFolder(), i)) dc, err := file.GetLazyData(fmt.Sprintf("%scet-4_%d.txt", en.DataFolder(), i), true, true)
以下是打印信息,到data/Wordle目录下面确实没有文件,看代码像是registry为nil
INFO[0012] [猜单词] data/Wordle/dict_7.txt
INFO[0012] [猜单词] data/Wordle/cet-4_5.txt
INFO[0012] [猜单词] data/Wordle/dict_5.txt
INFO[0012] [猜单词] data/Wordle/dict_6.txt
INFO[0012] [猜单词] data/Wordle/cet-4_7.txt
INFO[0012] [猜单词] data/Wordle/cet-4_6.txt
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x70b8ff]

@zyxdtk
Copy link
Author

zyxdtk commented Apr 18, 2022

哦,懂了,确实是文件没下载下来

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants