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)