Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32179123
D15034.1765071634.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D15034.1765071634.diff
View Options
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
@@ -1,5 +1,7 @@
// @flow
+import invariant from 'invariant';
+
function parseCookies(header: string): { +[string]: string } {
const values = header.split(';').map(v => v.split('='));
@@ -13,6 +15,7 @@
function getCookieIDFromCookie(cookie: string): string {
const cookieString = cookie.split('=').pop();
+ invariant(cookieString, 'invalid cookie');
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
@@ -20,6 +20,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();
+ invariant(filename, 'invalid blob URI');
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
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 7, 1:40 AM (18 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5842005
Default Alt Text
D15034.1765071634.diff (2 KB)
Attached To
Mode
D15034: [Flow262][skip-ci] Fix errors caused by pop() returning undefined
Attached
Detach File
Event Timeline
Log In to Comment