Skip to content

Commit 0c10e23

Browse files
fix: skip keys without :: separator in role lookup
Impact: 1 functions changed, 0 affected
1 parent 4f40eee commit 0c10e23

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/export.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,9 @@ export function exportMermaid(db, opts = {}) {
307307
const roleStyles = [];
308308
for (const key of allKeys) {
309309
const colonIdx = key.indexOf('::');
310-
const file = colonIdx !== -1 ? key.slice(0, colonIdx) : key;
311-
const name = colonIdx !== -1 ? key.slice(colonIdx + 2) : '';
310+
if (colonIdx === -1) continue;
311+
const file = key.slice(0, colonIdx);
312+
const name = key.slice(colonIdx + 2);
312313
const row = db
313314
.prepare('SELECT role FROM nodes WHERE file = ? AND name = ? AND role IS NOT NULL LIMIT 1')
314315
.get(file, name);

0 commit comments

Comments
 (0)