Fixed crash when picking relays if a neighbor wasn't in the db.
This commit is contained in:
parent
989ec6efb1
commit
6799deea9d
1 changed files with 4 additions and 1 deletions
|
@ -171,7 +171,10 @@ class Database(path: File, settings: SettingsInterface, callbackInterface: Callb
|
|||
val map = Await.result(db.run(knownDevices.result), Duration.Inf).toMap
|
||||
connections
|
||||
.toList
|
||||
.sortBy(map(_).getMillis)
|
||||
.sortBy { c =>
|
||||
val duration = map.get(c)
|
||||
duration.map(_.getMillis).getOrElse(0L)
|
||||
}
|
||||
.reverse
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue