Add check for when can't find parent ID and write to severe error log

codemagic-setup
Hank Grabowski 2023-02-08 17:24:04 +01:00
rodzic 04fa5395d3
commit 5c0677b923
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -283,6 +283,11 @@ class EntryManagerService extends ChangeNotifier {
final parentParentPostId = _postNodes.containsKey(item.parentId)
? item.parentId
: _parentPostIds[item.parentId];
if (_postNodes[parentParentPostId] == null) {
_logger.severe(
'Error finding parent ${item.parentId} for entry ${item.id}');
continue;
}
final parentPostNode = _postNodes[parentParentPostId]!;
postNodesToReturn.add(parentPostNode);
_parentPostIds[item.id] = parentPostNode.id;