fix: enhance knowledge base plugin status check to handle empty data response

This commit is contained in:
Soulter
2025-10-02 17:25:00 +08:00
parent 3007f67cab
commit 1b50c5404d
+2 -2
View File
@@ -601,11 +601,11 @@ export default {
checkPlugin() {
axios.get('/api/plugin/get?name=astrbot_plugin_knowledge_base')
.then(response => {
if (response.data.status !== 'ok') {
if (response.data.status !== 'ok' || response.data.data.length === 0) {
this.showSnackbar(this.tm('messages.pluginNotAvailable'), 'error');
return
}
if (!response.data.data.activated) {
if (!response.data.data[0].activated) {
this.showSnackbar(this.tm('messages.pluginNotActivated'), 'error');
return
}