From 5d21f5389ad7edd3b959ccfcc98f105417b5f247 Mon Sep 17 00:00:00 2001 From: Anduin1109 Date: Sat, 30 Aug 2025 11:09:58 +0800 Subject: [PATCH] fix GetTty crash Signed-off-by: Anduin1109 --- usb/serial/src/libusb_serial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usb/serial/src/libusb_serial.cpp b/usb/serial/src/libusb_serial.cpp index 7664e8ae0e..a25a4c6b63 100644 --- a/usb/serial/src/libusb_serial.cpp +++ b/usb/serial/src/libusb_serial.cpp @@ -606,7 +606,7 @@ std::string GetTtyDevicePath(const std::string& ttyDevice) fs::path ttyPath(ttyPathStr); if (!fs::exists(ttyPath) || !fs::is_symlink(ttyPath)) { HDF_LOGE("%{public}s: path %{public}s not exist", __func__, ttyPath.string().c_str()); - return NULL; + return ""; } fs::path realPath = fs::read_symlink(ttyPath); std::string tempPath = ttyPath.parent_path().string() + "/" + realPath.string(); -- Gitee