fix(scriptindex): Handle missing script metadata fields in ScriptIndex.search to prevent crashes

This commit is contained in:
2025-10-28 22:05:50 +00:00
parent ad7e9b0b46
commit 23f41cc152
3 changed files with 10 additions and 4 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@serve.zone/moxytool',
version: '1.4.1',
version: '1.4.2',
description: 'Proxmox administration tool for vGPU setup, VM management, and cluster configuration'
}

View File

@@ -263,9 +263,9 @@ export class ScriptIndex {
return this.cache.scripts.filter((script) => {
// Search in name, description, and slug
return (
script.name.toLowerCase().includes(lowerQuery) ||
script.slug.toLowerCase().includes(lowerQuery) ||
script.description.toLowerCase().includes(lowerQuery)
(script.name && script.name.toLowerCase().includes(lowerQuery)) ||
(script.slug && script.slug.toLowerCase().includes(lowerQuery)) ||
(script.description && script.description.toLowerCase().includes(lowerQuery))
);
});
}