Skip to content

Commit c8765bc

Browse files
committed
Fixed NPE in RewriteNavigationHandler (ocpsoft#103)
1 parent ba58396 commit c8765bc

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎integration-faces/src/main/java/org/ocpsoft/rewrite/faces/RewriteNavigationHandler.java‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,17 @@ public void handleNavigation(final FacesContext context, final String fromAction
5252

5353
String originalViewId = context.getViewRoot().getViewId();
5454
parent.handleNavigation(context, fromAction, outcome);
55-
String newViewId = context.getViewRoot().getViewId();
55+
56+
/*
57+
* the view root may be null if the navigation occurs before RESTORE_VIEW or as
58+
* a result of a ViewExpiredException
59+
*
60+
* https://github.com/ocpsoft/rewrite/issues/103
61+
*/
62+
String newViewId = null;
63+
if (context.getViewRoot() != null) {
64+
newViewId = context.getViewRoot().getViewId();
65+
}
5666

5767
/*
5868
* Navigation is complete if the viewId has not changed or the response is complete

0 commit comments

Comments
 (0)