WICKET-6001 Exception raised while refreshing a page with queued components 
missing in the markup

Check that there is an Application thread local first.
We've been bitten by such assumptions several times


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/c6fe37d3
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/c6fe37d3
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/c6fe37d3

Branch: refs/heads/lambdas
Commit: c6fe37d38f9d961a4227480bbee1ac2ed1d24599
Parents: 6970a4d
Author: Martin Tzvetanov Grigorov <[email protected]>
Authored: Wed Nov 18 23:47:41 2015 +0100
Committer: Martin Tzvetanov Grigorov <[email protected]>
Committed: Wed Nov 18 23:47:41 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/wicket/request/cycle/RequestCycle.java  | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/c6fe37d3/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycle.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycle.java 
b/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycle.java
index f0e4ff0..cdd9cc5 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycle.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycle.java
@@ -664,9 +664,12 @@ public class RequestCycle implements IRequestCycle, 
IEventSink
         */
        private void handleDetachException(RuntimeException exception) 
        {
-               boolean isBufferedResponse = Application.get().
-                               getRequestCycleSettings().getBufferResponse();
-               
+               boolean isBufferedResponse = true;
+               if (Application.exists())
+               {
+                       isBufferedResponse = 
Application.get().getRequestCycleSettings().getBufferResponse();
+               }
+
                //if application is using a buffered response strategy,
                //then we display exception to user.
                if (isBufferedResponse) 

Reply via email to