Merge pull request #1721 from randomSpirit/master

in case timeoutValue is null
pull/1730/head
Nikita Koksharov 6 years ago committed by GitHub
commit b764fef7d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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