Fixed an exception when the target server is unknown

master
WolverinDEV 2021-06-11 12:11:45 +02:00
parent 338212f84b
commit 253f537bb2
1 changed files with 6 additions and 1 deletions

View File

@ -480,11 +480,16 @@ export class ConnectionHistory {
const store = transaction.objectStore("attempt-history"); const store = transaction.objectStore("attempt-history");
const cursor = await new Promise<IDBCursorWithValue | null>((resolve, reject) => { const cursor = await new Promise<IDBCursorWithValue | null>((resolve, reject) => {
const cursor = store.index(targetType === "server-unique-id" ? "serverUniqueId" : "targetAddress").openCursor(target, "prev");; const cursor = store.index(targetType === "server-unique-id" ? "serverUniqueId" : "targetAddress").openCursor(target, "prev");
cursor.onsuccess = () => resolve(cursor.result); cursor.onsuccess = () => resolve(cursor.result);
cursor.onerror = () => reject(cursor.error); cursor.onerror = () => reject(cursor.error);
}); });
if(!cursor) {
/* We did not find any entry */
return undefined;
}
while(true) { while(true) {
if(!cursor.value) { if(!cursor.value) {
return undefined; return undefined;