about summary refs log tree commit diff stats
path: root/src/io/promise.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/promise.nim')
-rw-r--r--src/io/promise.nim11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/io/promise.nim b/src/io/promise.nim
index 3c01e214..55dcfbf0 100644
--- a/src/io/promise.nim
+++ b/src/io/promise.nim
@@ -59,12 +59,11 @@ proc resolve*(promise: EmptyPromise) =
     promise.next = nil
 
 proc resolve*[T](promise: Promise[T]; res: T) =
-  if promise.cb != nil:
-    if promise.get != nil:
-      promise.get(promise.opaque, promise.res)
-      promise.get = nil
-    promise.res = res
-    promise.resolve()
+  if promise.get != nil:
+    promise.get(promise.opaque, promise.res)
+    promise.get = nil
+  promise.res = res
+  promise.resolve()
 
 proc resolve*(map: var PromiseMap; promiseid: int) =
   var promise: EmptyPromise