Skip to content

Commit

Permalink
Prevent ugly stacktrace in DevUI when no RESTEasy Reactive endpoints …
Browse files Browse the repository at this point in the history
…exist

Fixes: quarkusio#20685
  • Loading branch information
geoand committed Oct 12, 2021
1 parent 2bd5fb0 commit d939562
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.quarkus.resteasy.reactive.server.runtime;

import java.util.Collections;
import java.util.function.Supplier;

import org.jboss.resteasy.reactive.server.util.ScoreSystem;
Expand All @@ -8,6 +9,11 @@ public class EndpointScoresSupplier implements Supplier<ScoreSystem.EndpointScor

@Override
public ScoreSystem.EndpointScores get() {
return ScoreSystem.latestScores;
var result = ScoreSystem.latestScores;
if (result != null) {
return result;
}

return new ScoreSystem.EndpointScores(0, Collections.emptyList());
}
}

0 comments on commit d939562

Please sign in to comment.