Fixed crash when picking relays if a neighbor wasn't in the db.

This commit is contained in:
Felix Ableitner 2016-07-15 20:45:29 +02:00
parent 989ec6efb1
commit 6799deea9d

View file

@ -171,7 +171,10 @@ class Database(path: File, settings: SettingsInterface, callbackInterface: Callb
val map = Await.result(db.run(knownDevices.result), Duration.Inf).toMap val map = Await.result(db.run(knownDevices.result), Duration.Inf).toMap
connections connections
.toList .toList
.sortBy(map(_).getMillis) .sortBy { c =>
val duration = map.get(c)
duration.map(_.getMillis).getOrElse(0L)
}
.reverse .reverse
} }