Skip to content

Commit

Permalink
Fix nullpointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Tharsanan1 committed Oct 7, 2024
1 parent deaa6cc commit bacebe8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,15 @@ public void handleSuccessRequest(RequestContext requestContext) {
public String resolveEndpoint(RequestContext requestContext) {

// For MockAPIs there is no backend, Hence "MockImplementation" is added as the destination.
if (requestContext.getMatchedAPI().isMockedApi()) {
if (requestContext.getMatchedAPI() != null && requestContext.getMatchedAPI().isMockedApi()) {
return "MockImplementation";
}
// This does not cause problems at the moment Since the current microgateway supports only one URL
return requestContext.getMatchedResourcePaths().get(0).getEndpoints().getUrls().get(0);
try {
return requestContext.getMatchedResourcePaths().get(0).getEndpoints().getUrls().get(0);
} catch (Exception e) {
return "";
}
}

public void handleFailureRequest(RequestContext requestContext) {
Expand Down

0 comments on commit bacebe8

Please sign in to comment.