Page MenuHomePhorge

D15034.1765090599.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D15034.1765090599.diff

diff --git a/keyserver/src/cron/backups.js b/keyserver/src/cron/backups.js
--- a/keyserver/src/cron/backups.js
+++ b/keyserver/src/cron/backups.js
@@ -265,6 +265,9 @@
const sortedBackupInfos = await getSortedBackupInfos();
const mostRecentBackup = sortedBackupInfos.pop();
+ if (!mostRecentBackup) {
+ return;
+ }
let bytesLeft = maxDirSizeMiB * 1024 * 1024 - mostRecentBackup.bytes;
const deleteBackupPromises = [];
diff --git a/lib/shared/radix-tree.js b/lib/shared/radix-tree.js
--- a/lib/shared/radix-tree.js
+++ b/lib/shared/radix-tree.js
@@ -97,7 +97,11 @@
+partLeft: string,
}> = [{ node: this.root, partLeft: prefix }];
while (stack.length > 0) {
- const { node, partLeft: prevPartLeft } = stack.pop();
+ const top = stack.pop();
+ if (!top) {
+ break;
+ }
+ const { node, partLeft: prevPartLeft } = top;
if (node.leaf) {
for (const value of node.values) {
result.add(value);
diff --git a/lib/shared/threads/protocols/dm-thread-protocol.js b/lib/shared/threads/protocols/dm-thread-protocol.js
--- a/lib/shared/threads/protocols/dm-thread-protocol.js
+++ b/lib/shared/threads/protocols/dm-thread-protocol.js
@@ -940,6 +940,7 @@
threadInfo: ThickRawThreadInfo,
): CreateThickRawThreadInfoInput {
const roleID = Object.keys(threadInfo.roles).pop();
+ invariant(roleID, 'roleID must be set');
const thickThreadType = assertThickThreadType(threadInfo.type);
return {
threadID: threadInfo.id,
diff --git a/lib/utils/cookie-utils.js b/lib/utils/cookie-utils.js
--- a/lib/utils/cookie-utils.js
+++ b/lib/utils/cookie-utils.js
@@ -12,7 +12,7 @@
}
function getCookieIDFromCookie(cookie: string): string {
- const cookieString = cookie.split('=').pop();
+ const cookieString = cookie.split('=').pop() ?? '';
const [cookieID] = cookieString.split(':');
return cookieID;
}
diff --git a/native/media/media-cache.js b/native/media/media-cache.js
--- a/native/media/media-cache.js
+++ b/native/media/media-cache.js
@@ -19,7 +19,7 @@
function basenameFromBlobURI(blobURI: string) {
// if blobURI is a file URI or path, use the last segment of the path
- const filename = blobURI.split('/').pop();
+ const filename = blobURI.split('/').pop() ?? '';
return filenameWithoutExtension(filename);
}
diff --git a/native/navigation/modal-pruner.react.js b/native/navigation/modal-pruner.react.js
--- a/native/navigation/modal-pruner.react.js
+++ b/native/navigation/modal-pruner.react.js
@@ -81,6 +81,7 @@
const toResolve = [...presenting];
while (toResolve.length > 0) {
const presentee = toResolve.pop();
+ invariant(presentee, 'could not find presentee');
const dependencyInfo = dependencyMap.get(presentee);
invariant(dependencyInfo, 'could not find presentee');
dependencyInfo.status = 'resolved';

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 7, 6:56 AM (19 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5842009
Default Alt Text
D15034.1765090599.diff (2 KB)

Event Timeline