DUBBO-11 NPE问题解决.

git-svn-id: http://code.alibabatech.com/svn/dubbo/trunk@109 1a56cb94-b969-4eaa-88fa-be21384802f2
This commit is contained in:
chao.liuc 2011-10-28 07:33:01 +00:00
parent 1aa17bca4a
commit 12673832b1
1 changed files with 11 additions and 2 deletions

View File

@ -70,8 +70,17 @@ public class FutureFilter implements Filter {
if (f instanceof FutureAdapter) {
ResponseFuture future = ((FutureAdapter<?>)f).getFuture();
future.setCallback(new ResponseCallback() {
public void done(Object response) {
Result result = (Result) response;
public void done(Object rpcResult) {
if (rpcResult == null){
logger.error(new IllegalStateException("invalid result value : null, expected "+Result.class.getName()));
return;
}
///must be rpcResult
if (! (rpcResult instanceof Result)){
logger.error(new IllegalStateException("invalid result type :" + rpcResult.getClass() + ", expected "+Result.class.getName()));
return;
}
Result result = (Result) rpcResult;
if (result.hasException()) {
fireThrowCallback(invoker, invocation, result.getException());
} else {