mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-11 08:20:36 +00:00
fix: Guard null history decode #123
This commit is contained in:
@@ -69,12 +69,17 @@ class PathHistoryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final decoded = jsonDecode(raw);
|
if (raw != null && raw.isNotEmpty) {
|
||||||
if (decoded is Map<String, dynamic>) {
|
final decoded = jsonDecode(raw);
|
||||||
for (final entry in decoded.entries) {
|
if (decoded is Map<String, dynamic>) {
|
||||||
final value = entry.value;
|
for (final entry in decoded.entries) {
|
||||||
if (value is Map<String, dynamic>) {
|
final value = entry.value;
|
||||||
_cache[entry.key] = ContactPathHistory.fromJson(entry.key, value);
|
if (value is Map<String, dynamic>) {
|
||||||
|
_cache[entry.key] = ContactPathHistory.fromJson(
|
||||||
|
entry.key,
|
||||||
|
value,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user