Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32179116
D15050.1765071622.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D15050.1765071622.diff
View Options
diff --git a/keyserver/src/creators/role-creator.js b/keyserver/src/creators/role-creator.js
--- a/keyserver/src/creators/role-creator.js
+++ b/keyserver/src/creators/role-creator.js
@@ -1,5 +1,7 @@
// @flow
+import invariant from 'invariant';
+
import { getThreadPermissionBlobFromUserSurfacedPermissions } from 'lib/permissions/keyserver-permissions.js';
import {
defaultSpecialRoles,
@@ -48,6 +50,7 @@
const namesToIDs: { [string]: string } = {};
for (const name in rolePermissions) {
const id = ids.shift();
+ invariant(id !== undefined, 'no role id created');
namesToIDs[name] = id;
const permissionsBlob = JSON.stringify(rolePermissions[name]);
const specialRole = defaultSpecialRoles[name] ?? null;
diff --git a/keyserver/src/creators/upload-creator.js b/keyserver/src/creators/upload-creator.js
--- a/keyserver/src/creators/upload-creator.js
+++ b/keyserver/src/creators/upload-creator.js
@@ -1,6 +1,7 @@
// @flow
import crypto from 'crypto';
+import invariant from 'invariant';
import type {
MediaType,
@@ -46,6 +47,7 @@
const ids = await createIDs('uploads', uploadInfos.length);
const uploadRows = uploadInfos.map(uploadInfo => {
const id = ids.shift();
+ invariant(id !== undefined, 'no role id created');
const secret = crypto.randomBytes(8).toString('hex');
const { content, dimensions, mediaType, loop, encryptionKey, thumbHash } =
uploadInfo;
diff --git a/native/redux/persist.js b/native/redux/persist.js
--- a/native/redux/persist.js
+++ b/native/redux/persist.js
@@ -461,6 +461,9 @@
const stack = [...rootIDs];
while (stack.length > 0) {
const threadID = stack.shift();
+ if (!threadID) {
+ break;
+ }
const threadInfo = state.threadStore.threadInfos[threadID];
const parentThreadInfo = threadInfo.parentThreadID
? threadInfos[threadInfo.parentThreadID]
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 7, 1:40 AM (14 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5841999
Default Alt Text
D15050.1765071622.diff (1 KB)
Attached To
Mode
D15050: [Flow262][skip-ci] Fix shift() returns undefined
Attached
Detach File
Event Timeline
Log In to Comment