@@ -219,17 +219,17 @@ public boolean checkResourceExists(Locale locale) throws Exception {
219
219
* @see org.springframework.web.reactive.result.view.AbstractView#getModelAttributes(Map, ServerWebExchange)
220
220
*/
221
221
@ Override
222
- protected Mono <Map <String , Object >> getModelAttributes (Map < String , ?> model ,
223
- ServerWebExchange exchange ) {
222
+ protected Mono <Map <String , Object >> getModelAttributes (
223
+ @ Nullable Map < String , ?> model , ServerWebExchange exchange ) {
224
224
225
225
if (this .exposeSpringMacroHelpers ) {
226
- if (model .containsKey (SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE )) {
226
+ if (model != null && model .containsKey (SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE )) {
227
227
throw new IllegalStateException (
228
228
"Cannot expose bind macro helper '" + SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE +
229
229
"' because of an existing model object of the same name" );
230
230
}
231
231
// Make a defensive copy of the model.
232
- Map <String , Object > attributes = new HashMap <>(model );
232
+ Map <String , Object > attributes = ( model != null ? new HashMap <>(model ) : new HashMap <>() );
233
233
// Expose RequestContext instance for Spring macros.
234
234
attributes .put (SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE , new RequestContext (
235
235
exchange , attributes , obtainApplicationContext (), getRequestDataValueProcessor ()));
0 commit comments