Fixed an exception when the target server is unknown
parent
338212f84b
commit
253f537bb2
|
@ -480,11 +480,16 @@ export class ConnectionHistory {
|
|||
const store = transaction.objectStore("attempt-history");
|
||||
|
||||
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.onerror = () => reject(cursor.error);
|
||||
});
|
||||
|
||||
if(!cursor) {
|
||||
/* We did not find any entry */
|
||||
return undefined;
|
||||
}
|
||||
|
||||
while(true) {
|
||||
if(!cursor.value) {
|
||||
return undefined;
|
||||
|
|
Loading…
Reference in New Issue