Skip to content

Commit

Permalink
Fix the problem with Template#getFragment() on quarkus 3.5+
Browse files Browse the repository at this point in the history
  • Loading branch information
mkouba committed Nov 14, 2023
1 parent bb810d5 commit 1df571d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ private void handlePage(RoutingContext rc) {
// It is possible to specify the fragment via query param, e.g. /item?frag=detail
String fragmentId = rc.request().getParam(FRAGMENT_PARAM);
if (fragmentId != null) {
Fragment fragment = template.getFragment(fragmentId);
// Note that we have to use the original instance to obtain the fragment
// because getFragment() invoked upon the injectable template returns an injectable fragment and never null
Fragment fragment = originalInstance.getTemplate().getFragment(fragmentId);
if (fragment == null) {
LOG.errorf("Fragment [%s] not found: %s", fragmentId, rc.request().path());
rc.response().setStatusCode(404).end();
Expand Down

0 comments on commit 1df571d

Please sign in to comment.