From 2b6bdfe2771b1db83f51c33911eaa4130ff73769 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 4 Oct 2018 10:16:10 -0700 Subject: [PATCH] Fix Reactive...Context NPE Fix possible NPE in `ReactiveWebServerApplicationContext`. See gh-14666 --- .../reactive/context/ReactiveWebServerApplicationContext.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContext.java index 75e5af057f6..fddab189f29 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContext.java @@ -227,14 +227,14 @@ public class ReactiveWebServerApplicationContext public static void start(ServerManager manager, Supplier handlerSupplier) { - if (manager != null) { + if (manager != null && manager.server != null) { manager.handler = handlerSupplier.get(); manager.server.start(); } } public static void stop(ServerManager manager) { - if (manager != null) { + if (manager != null && manager.server != null) { try { manager.server.stop(); }