Browse Source

fix: work around a null scoped_ptr dereference (#19366)

This happens occasionally when running the test suite and indicates
that the callback's been reset or the underlying reference has been
released. To workaround, print a warning.
Richard Townsend 5 years ago
parent
commit
0491abf4cc
1 changed files with 4 additions and 0 deletions
  1. 4 0
      atom/browser/api/atom_api_session.cc

+ 4 - 0
atom/browser/api/atom_api_session.cc

@@ -512,6 +512,10 @@ void WrapVerifyProc(base::Callback<void(const VerifyRequestParams& request,
                                         base::Callback<void(int)>)> proc,
                     const VerifyRequestParams& request,
                     base::OnceCallback<void(int)> cb) {
+  if (proc.is_null()) {
+    LOG(ERROR) << "WrapVerifyProc (proc=null)";
+    return;
+  }
   proc.Run(request, base::AdaptCallbackForRepeating(std::move(cb)));
 }