File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/main/java/com/contrast/labs/ai/mcp/contrast Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,13 @@ public RouteCoverageResponse getRouteCoverageByAppIDLatestSession(String app_id)
165
165
SDKExtension sdkExtension = new SDKExtension (contrastSDK );
166
166
SDKExtension extension = new SDKExtension (contrastSDK );
167
167
SessionMetadataResponse latest = extension .getLatestSessionMetadata (orgID ,app_id );
168
+ if (latest == null || latest .getAgentSession () == null ) {
169
+ logger .error ("No session metadata found for application ID: {}" , app_id );
170
+ RouteCoverageResponse noRouteCoverageResponse = new RouteCoverageResponse ();
171
+ noRouteCoverageResponse .setSuccess (Boolean .FALSE );
172
+ logger .debug ("No Agent session found in latest session metadata response for application ID: {}" , app_id );
173
+ return noRouteCoverageResponse ; // Return empty response if no session metadata found
174
+ }
168
175
RouteCoverageBySessionIDAndMetadataRequestExtended requestExtended = new RouteCoverageBySessionIDAndMetadataRequestExtended ();
169
176
requestExtended .setSessionId (latest .getAgentSession ().getAgentSessionId ());
170
177
logger .debug ("Fetching route coverage data for application ID: {}" , app_id );
You can’t perform that action at this time.
0 commit comments