From 383fe201682b160ba57fa50725dfd4511c08f6eb Mon Sep 17 00:00:00 2001 From: zhangzq Date: Tue, 5 Nov 2024 16:07:14 +0800 Subject: [PATCH] =?UTF-8?q?add:com=E5=8F=A3=E8=AF=BB=E5=8F=96=E5=B7=A5?= =?UTF-8?q?=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/org/nl/common/utils/ComPortUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/ComPortUtil.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/ComPortUtil.java index 55bab01..91575f1 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/ComPortUtil.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/common/utils/ComPortUtil.java @@ -54,7 +54,9 @@ public class ComPortUtil { if (bytesRead > 0) { String msg = new String(buffer, 0, bytesRead); System.out.println("--获取COM口信息--"+msg); - function.apply(msg); + if (function != null){ + function.apply(msg); + } } } } catch (Exception e) {