Skip to content

Commit 4092716

Browse files
committed
Fix test failure with encrypted state: handle empty string state key
1 parent 8d0d410 commit 4092716

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spec/integ/crypto/olm-utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ export function encryptMegolmEventRawPlainText(opts: {
305305
},
306306
type: "m.room.encrypted",
307307
unsigned: {},
308-
state_key: opts.plaintext.state_key ? `${opts.plaintext.type}:${opts.plaintext.state_key}` : undefined,
308+
state_key: opts.plaintext.hasOwnProperty("state_key")
309+
? `${opts.plaintext.type}:${opts.plaintext.state_key}`
310+
: undefined,
309311
};
310312
}
311313

0 commit comments

Comments
 (0)