Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Unified Diff: webrtc/api/android/jni/peerconnection_jni.cc

Issue 2181933002: Don't crash if createDataChannel fails. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Change warning level to error. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/android/jni/peerconnection_jni.cc
diff --git a/webrtc/api/android/jni/peerconnection_jni.cc b/webrtc/api/android/jni/peerconnection_jni.cc
index 8b5a69251be33180fcfb5170046a4a023a6e4b92..9efe037c9ff2d036976dce06c2e8029ff146a696 100644
--- a/webrtc/api/android/jni/peerconnection_jni.cc
+++ b/webrtc/api/android/jni/peerconnection_jni.cc
@@ -1726,7 +1726,10 @@ JOW(jobject, PeerConnection_createDataChannel)(
// vararg parameter as 64-bit and reading memory that doesn't belong to the
// 32-bit parameter.
jlong nativeChannelPtr = jlongFromPointer(channel.get());
- RTC_CHECK(nativeChannelPtr) << "Failed to create DataChannel";
+ if (!nativeChannelPtr) {
+ LOG(LS_ERROR) << "Failed to create DataChannel";
+ return nullptr;
+ }
jclass j_data_channel_class = FindClass(jni, "org/webrtc/DataChannel");
jmethodID j_data_channel_ctor = GetMethodID(
jni, j_data_channel_class, "<init>", "(J)V");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698