From e7db0500592989c1bd91f23613c4a354847e947d Mon Sep 17 00:00:00 2001 From: Murat Dogan Date: Fri, 6 Jan 2023 18:27:40 +0100 Subject: [PATCH] return data channel id or -1 --- src/data-channel-wrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data-channel-wrapper.cpp b/src/data-channel-wrapper.cpp index b544100..625547a 100644 --- a/src/data-channel-wrapper.cpp +++ b/src/data-channel-wrapper.cpp @@ -103,7 +103,7 @@ Napi::Value DataChannelWrapper::getId(const Napi::CallbackInfo &info) return info.Env().Null(); } - return Napi::Number::New(info.Env(), mDataChannelPtr->id().value()); + return Napi::Number::New(info.Env(), mDataChannelPtr->id().value_or(-1)); } Napi::Value DataChannelWrapper::getProtocol(const Napi::CallbackInfo &info)