mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
fix(linked-docs): fix TypeError when no metadata
This commit is contained in:
parent
ff552b968e
commit
e98fc20849
@ -143,7 +143,7 @@ Linked.addLinkedDocument = (Env, data, cb, _S, userId) => {
|
||||
|
||||
nThen(waitFor => {
|
||||
getMetadata(Env, channel, waitFor((err, metadata) => {
|
||||
if (!metadata.validateKey) {
|
||||
if (!metadata?.validateKey) {
|
||||
waitFor.abort();
|
||||
return void cb(err || 'METADATA_ERROR');
|
||||
}
|
||||
@ -182,7 +182,7 @@ Linked.resetLinkedDocuments = (Env, data, cb, _S, userId) => {
|
||||
|
||||
nThen(waitFor => {
|
||||
getMetadata(Env, channel, waitFor((err, metadata) => {
|
||||
if (!metadata.validateKey) {
|
||||
if (!metadata?.validateKey) {
|
||||
waitFor.abort();
|
||||
return void cb(err || 'METADATA_ERROR');
|
||||
}
|
||||
@ -269,7 +269,7 @@ Linked.removeLinkedDocument = (Env, allData, cb, _S, userId) => {
|
||||
let validateKey;
|
||||
nThen(waitFor => {
|
||||
getMetadata(Env, channel, waitFor((err, metadata) => {
|
||||
if (!metadata.validateKey) {
|
||||
if (!metadata?.validateKey) {
|
||||
waitFor.abort();
|
||||
return void cb(err || 'METADATA_ERROR');
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user