diff --git a/usb/serial/src/libusb_serial.cpp b/usb/serial/src/libusb_serial.cpp index 7664e8ae0e321b06f1052442e6f893a87832ae8b..a25a4c6b6395c626ea9c47c3fe87d441f9fac979 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();