in case timeoutValue is null

pull/1721/head
junwu215177 6 years ago
parent a71460624e
commit 39eba7f314

@ -74,7 +74,9 @@ public class RedissonAutoConfiguration {
Method timeoutMethod = ReflectionUtils.findMethod(RedisProperties.class, "getTimeout");
Object timeoutValue = ReflectionUtils.invokeMethod(timeoutMethod, redisProperties);
int timeout;
if (!(timeoutValue instanceof Integer)) {
if(null == timeoutValue){
timeout = 0;
}else if (!(timeoutValue instanceof Integer)) {
Method millisMethod = ReflectionUtils.findMethod(timeoutValue.getClass(), "toMillis");
timeout = ((Long) ReflectionUtils.invokeMethod(millisMethod, timeoutValue)).intValue();
} else {

Loading…
Cancel
Save