Fix npe when hessian deserialize (#10659)

* fix npe

* fix npe when result is null

* remove redundant code
This commit is contained in:
chenyiqin 2023-06-26 09:39:24 +08:00 committed by GitHub
parent ecd8ed815a
commit d82687c493
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,6 +51,9 @@ public class HessianSerializer implements Serializer {
@Override
public <T> T deserialize(byte[] data, Class<T> cls) {
T result = deserialize(data);
if (result == null) {
return null;
}
if (cls.isAssignableFrom(result.getClass())) {
return result;
}