fix(linked-doc): typeError when content cannot be parsed

This commit is contained in:
Fabrice Mouhartem 2026-08-13 14:39:20 +02:00
parent ce8364a025
commit f3f06d833b
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -688,7 +688,7 @@ const factory = (Sortify, UserObject, ProxyManager,
const value = {
checkpoints: []
};
let hashes = content.hashes || {}; // checkpoints
let hashes = content?.hashes || {}; // checkpoints
let sortedCp = Object.keys(hashes).map(Number).sort((a, b) => a-b).slice(-10);
sortedCp.forEach(cpIdx => {
const cpData = hashes[cpIdx];
@ -713,7 +713,7 @@ const factory = (Sortify, UserObject, ProxyManager,
store.modules['linked-doc'].checkCurrentDoc({
channel: chan,
expectedJSON: value,
signKey64: secret.keys?.signKey
signKey64: secret?.keys?.signKey
}, cb);
}, opts);
};

File diff suppressed because one or more lines are too long