fixes for null checks
This commit is contained in:
parent
62a4ea785a
commit
b086aa49c1
2 changed files with 3 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ import 'dart:async';
|
|||
import 'dart:developer';
|
||||
|
||||
import 'package:fluffychat/pangea/controllers/pangea_controller.dart';
|
||||
import 'package:fluffychat/pangea/enum/construct_type_enum.dart';
|
||||
import 'package:fluffychat/pangea/models/student_analytics_summary_model.dart';
|
||||
import 'package:fluffychat/pangea/utils/error_handler.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
|
@ -96,7 +97,7 @@ class MyAnalyticsController {
|
|||
saveFutures.add(
|
||||
analyticsRoom.saveConstructUsesSameLemma(
|
||||
uses.key,
|
||||
uses.value.first.constructType!,
|
||||
uses.value.first.constructType ?? ConstructType.grammar,
|
||||
uses.value,
|
||||
isEdit: isEdit,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ class ConstructEvent {
|
|||
Client client,
|
||||
) async {
|
||||
_contentCache ??= ConstructUses.fromJson(event.content);
|
||||
if (_contentCache == null || _event.stateKey == null) return;
|
||||
final previousLength = _contentCache!.uses.length;
|
||||
_contentCache!.uses.removeWhere(
|
||||
(element) => removeIds.contains(element.msgId),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue