mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
Improve
This commit is contained in:
@@ -23,7 +23,11 @@ class ServerStore extends PersistentStore {
|
||||
|
||||
void update(ServerPrivateInfo old, ServerPrivateInfo newInfo) {
|
||||
final ss = fetch();
|
||||
ss[index(old)] = newInfo;
|
||||
final idx = index(old);
|
||||
if (idx < 0) {
|
||||
throw RangeError.index(idx, ss);
|
||||
}
|
||||
ss[idx] = newInfo;
|
||||
box.put('servers', json.encode(ss));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user