From bf67fb61cedb86020f87c084a5bc12799ec90d27 Mon Sep 17 00:00:00 2001 From: Matthias Keck Date: Thu, 28 Nov 2024 16:35:23 +0100 Subject: [PATCH] We must properly wire the object before attaching it - or else race conditions might occur where the wiring has not happened yet Fixes: SE-13624 --- .../sirius/kernel/di/transformers/AutoTransformLoadAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/sirius/kernel/di/transformers/AutoTransformLoadAction.java b/src/main/java/sirius/kernel/di/transformers/AutoTransformLoadAction.java index 666e6e52..a104cc6e 100644 --- a/src/main/java/sirius/kernel/di/transformers/AutoTransformLoadAction.java +++ b/src/main/java/sirius/kernel/di/transformers/AutoTransformLoadAction.java @@ -83,6 +83,7 @@ public int getPriority() { public T make(@Nonnull Object source) { try { T result = createInstance(source); + globalContext.wire(result); if (source instanceof Composable composable && additionalTargetTypes != null) { for (Class additionalTarget : additionalTargetTypes) { @@ -90,7 +91,6 @@ public T make(@Nonnull Object source) { } } - globalContext.wire(result); return result; } catch (InvocationTargetException exception) { if (exception.getCause() instanceof IllegalArgumentException) {