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) {