matrei commented on code in PR #15654:
URL: https://github.com/apache/grails-core/pull/15654#discussion_r3279013315


##########
grails-async/core/src/main/groovy/org/grails/async/factory/future/FutureTaskPromise.groovy:
##########
@@ -84,19 +84,23 @@ class FutureTaskPromise<T> extends FutureTask<T> implements 
Promise<T> {
     @Override
     protected void set(T t) {
         super.set(t)
-        synchronized (successCallbacks) {
-            for (FutureTaskChildPromise callback : successCallbacks) {
-                callback.accept(t)
+        if (successCallbacks != null) {
+            synchronized (successCallbacks) {
+                for (FutureTaskChildPromise callback : successCallbacks) {
+                    callback.accept(t)
+                }
             }
         }
     }
 
     @Override
     protected void setException(Throwable t) {
         super.setException(t)
-        synchronized (failureCallbacks) {
-            for (FutureTaskChildPromise callback : failureCallbacks) {
-                callback.accept(t)
+        if (failureCallbacks != null) {
+            synchronized (failureCallbacks) {
+                for (FutureTaskChildPromise callback : failureCallbacks) {
+                    callback.accept(t)
+                }

Review Comment:
   Why was this changed?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to