Merge pull request #384 from ascrutae/zhangxin/fix/jdbc-issue

fix jdbc plugin issue
This commit is contained in:
吴晟 Wu Sheng 2017-09-01 22:39:37 +08:00 committed by GitHub
commit 7deeedea63
1 changed files with 6 additions and 2 deletions

View File

@ -23,8 +23,12 @@ public class JDBCDriverInterceptor implements InstanceMethodsAroundInterceptor {
@Override public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments,
Class<?>[] argumentsTypes, Object ret) throws Throwable {
return new SWConnection((String)allArguments[0],
(Properties)allArguments[1], (Connection)ret);
if (ret != null) {
return new SWConnection((String)allArguments[0],
(Properties)allArguments[1], (Connection)ret);
}
return ret;
}
@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,