feat: add package source compatibility controls
This commit is contained in:
@@ -25,10 +25,7 @@ class RuntimeStorageManager {
|
||||
try {
|
||||
final raw = jsonDecode(file.readAsStringSync());
|
||||
if (raw is Map) {
|
||||
return RuntimeStorageManager._(
|
||||
file,
|
||||
Map<String, Object?>.from(raw),
|
||||
);
|
||||
return RuntimeStorageManager._(file, Map<String, Object?>.from(raw));
|
||||
}
|
||||
} catch (_) {
|
||||
// Corrupt storage should not prevent a game from loading.
|
||||
@@ -78,7 +75,8 @@ class RuntimeStorageManager {
|
||||
}
|
||||
if (value is Map) {
|
||||
return {
|
||||
for (final entry in value.entries) entry.key.toString(): _normalize(entry.value),
|
||||
for (final entry in value.entries)
|
||||
entry.key.toString(): _normalize(entry.value),
|
||||
};
|
||||
}
|
||||
return value.toString();
|
||||
|
||||
Reference in New Issue
Block a user