Skip to content

Commit a59ab5b

Browse files
authored
Merge pull request #195 from takker99:fix-linksLc
fix: `links2hop[].linksLc`に、そのページ内の全てのリンクが含まれるようになった
2 parents b6e804c + 894ded9 commit a59ab5b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

convert.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ export const convert = (
5656
const linkLc of card.linksLc.filter((linkLc) => linksLc.includes(linkLc))
5757
) {
5858
const cardId = toId(project, linkLc);
59-
const bubble = storage.get(cardId);
60-
if (!bubble) throw Error(`storage already must have "${cardId}"`);
59+
const bubble = storage.get(cardId) ?? makeDummy(project, linkLc);
6160
if (!bubble.linked) {
6261
bubble.linked = [card.titleLc];
6362
continue;
@@ -99,8 +98,7 @@ export const convert = (
9998
// 逆リンクを作る
10099
// 重複はありえないので配列でいい
101100
const cardId = toId(project, linkLc);
102-
const bubble = storage.get(cardId);
103-
if (!bubble) throw Error(`storage already must have "${cardId}"`);
101+
const bubble = storage.get(cardId) ?? makeDummy(project, linkLc);
104102
if (!bubble.linked) {
105103
bubble.linked = [card.titleLc];
106104
continue;

0 commit comments

Comments
 (0)