Skip to content

Commit

Permalink
Polish apache#3429 : Fix the NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
mercyblitz committed Feb 22, 2019
1 parent 31ecb9d commit 7afef6a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ private ReferenceBeanInvocationHandler(ReferenceBean referenceBean) {
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
Object result = null;
try {
if (bean == null) { // If the bean is not initialized, invoke init()
// issue: https://github.com/apache/incubator-dubbo/issues/3429
init();
}
result = method.invoke(bean, args);
} catch (InvocationTargetException e) {
// re-throws the actual Exception.
Expand Down

0 comments on commit 7afef6a

Please sign in to comment.