Skip to content

Build your personal knowledge base with Trilium Notes

fix wrong behavior when customResourceProvider has empty value, fixes #1393

zadamce33eb3abdea
diff --git a/src/routes/custom.js b/src/routes/custom.js
index 5f26a42761..5c811b425e 100644
--- a/src/routes/custom.js
+++ b/src/routes/custom.js
@@ -12,6 +12,10 @@ async function handleRequest(req, res) {
const attrs = repository.getEntities("SELECT * FROM attributes WHERE isDeleted = 0 AND type = 'label' AND name IN ('customRequestHandler', 'customResourceProvider')");
for (const attr of attrs) {
+ if (!attr.value.trim()) {
+ continue;
+ }
+
const regex = new RegExp(attr.value);
let match;