Make SemiFuture::via throw on nullptr executor.
[folly.git] / folly / futures / Future-inl.h
index 20cf87bc647a449fe462ca9b67195e3d1eecb39d..dea9e863095638bf62e82ca77b02734c5c0fa8ca 100644 (file)
@@ -483,6 +483,9 @@ void SemiFuture<T>::boost_() {
 template <class T>
 inline Future<T> SemiFuture<T>::via(Executor* executor, int8_t priority) && {
   throwIfInvalid();
+  if (!executor) {
+    throwNoExecutor();
+  }
 
   // If current executor is deferred, boost block to ensure that work
   // progresses and is run on the new executor.