Fix server crash in auto login

This commit is contained in:
Cohee 2024-04-23 21:11:47 +03:00
parent a421af9ea9
commit 71f41d5233

View File

@ -511,7 +511,7 @@ async function tryAutoLogin(request) {
const userHandles = await getAllUserHandles();
if (userHandles.length === 1) {
const user = await storage.getItem(toKey(userHandles[0]));
if (!user.password) {
if (user && !user.password) {
request.session.handle = userHandles[0];
return true;
}