From 361a4c441e593741a961eba4d0059c75582f3e7d Mon Sep 17 00:00:00 2001 From: "sky.min" Date: Wed, 7 Jan 2026 13:53:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=B8=BF=E8=92=99=E6=89=8B=E6=9C=BA-=E5=9B=BE?= =?UTF-8?q?=E4=BC=A0=E9=94=81-=E9=A6=96=E6=AC=A1=E9=85=8D=E7=BD=AEwifi?= =?UTF-8?q?=E7=9A=84KeyId=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/blue/sender_beforeDataManage.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/blue/sender_beforeDataManage.dart b/lib/blue/sender_beforeDataManage.dart index 09d83cca..14f59aeb 100755 --- a/lib/blue/sender_beforeDataManage.dart +++ b/lib/blue/sender_beforeDataManage.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:flutter/cupertino.dart'; import 'package:star_lock/blue/entity/lock_user_no_list_entity.dart'; import 'package:star_lock/blue/io_protocol/io_cleanUpUsers.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; @@ -276,6 +277,12 @@ class SenderBeforeDataManage { // 普通用户接收电子钥匙之后 更新锁用户NO Future _updateLockUserNo(List dataList) async { + // 使用空值感知操作符安全访问 keyId + final String? keyId = CommonDataManage().currentKeyInfo.keyId?.toString(); + if (keyId == null) { + debugPrint('keyId获取失败'); + return; + } final LockNetTokenEntity entity = await ApiRepository.to.updateLockUserNo( keyId: CommonDataManage().currentKeyInfo.keyId.toString(), lockUserNo: CommonDataManage().currentKeyInfo.lockUserNo.toString()); if (entity.errorCode!.codeIsSuccessful) {