Skip to content

Commit 8e609cd

Browse files
committed
fix(native): Resolve NullPointerException in ReferenceBeanManager
This commit adds a defensive null-check for `moduleModel`. If it is null, it retrieves the model explicitly using `DubboBeanUtils.getModuleModel()` to prevent the `NullPointerException` and ensure stable initialization in native builds. fixes: #15663 Signed-off-by: Kyounghoon Jang <[email protected]>
1 parent a7b641f commit 8e609cd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/reference/ReferenceBeanManager.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ public void prepareReferenceBeans() throws Exception {
154154
for (ReferenceBean referenceBean : getReferences()) {
155155
initReferenceBean(referenceBean);
156156
}
157+
// add a null check for moduleModel to be compatible with the native environment
158+
if (moduleModel == null) {
159+
setApplicationContext(applicationContext);
160+
}
157161
}
158162

159163
/**

0 commit comments

Comments
 (0)