DATACMNS-929 - Fixed NullPointerException in PageableHandlerMethodArgumentResolver.

PageableHandlerMethodArgumentResolver.isFallbackPageable() now correctly guards against the fallback Pageable being null, a situation that's explicitly deemed valid in setFallbackPageable(…).
This commit is contained in:
Oliver Gierke
2016-10-29 18:04:46 +01:00
parent 0f76ffd491
commit 2e4e6ee61f
2 changed files with 17 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2015 the original author or authors.
* Copyright 2013-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -95,12 +95,12 @@ public class PageableHandlerMethodArgumentResolver implements HandlerMethodArgum
/**
* Returns whether the given {@link Pageable} is the fallback one.
*
* @param pageable
* @param pageable can be {@literal null}.
* @since 1.9
* @return
*/
public boolean isFallbackPageable(Pageable pageable) {
return this.fallbackPageable.equals(pageable);
return fallbackPageable == null ? false : fallbackPageable.equals(pageable);
}
/**