Conform more of the codebase with strictNullChecks
(#10703)
This commit is contained in:
parent
db40479910
commit
619a9e8542
24 changed files with 108 additions and 77 deletions
|
@ -83,7 +83,11 @@ export default class ThreepidInviteStore extends EventEmitter {
|
|||
for (let i = 0; i < localStorage.length; i++) {
|
||||
const keyName = localStorage.key(i);
|
||||
if (!keyName?.startsWith(STORAGE_PREFIX)) continue;
|
||||
results.push(JSON.parse(localStorage.getItem(keyName)) as IPersistedThreepidInvite);
|
||||
try {
|
||||
results.push(JSON.parse(localStorage.getItem(keyName)!) as IPersistedThreepidInvite);
|
||||
} catch (e) {
|
||||
console.warn("Failed to parse 3pid invite", e);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue