Skip to content

Conversation

@homestar9
Copy link
Contributor

If you set this.unLoadColdbox = true; in your tests, there won't be a ColdboxVirtualApp in the request scope and the page will throw an exception "The key [COLDBOXVIRTUALAPP] does not exist in the request scope, the structure is empty"

Type of change

  • Bug Fix

Checklist

If you set `this.unLoadColdbox = true; ` in your tests, there won't be a `ColdboxVirtualApp` in the `request` scope and the page will throw an exception "The key [COLDBOXVIRTUALAPP] does not exist in the request scope, the structure is empty"
Copilot AI review requested due to automatic review settings January 10, 2026 19:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where the onRequestEnd method in the test harness throws an exception when this.unLoadColdbox = true is set in tests. The fix adds a defensive check to verify the existence of coldBoxVirtualApp in the request scope before attempting to call its shutdown method.

Changes:

  • Added conditional check in onRequestEnd to prevent exception when coldBoxVirtualApp is not in the request scope

Comment on lines +78 to +79
request.coldBoxVirtualApp.shutdown();
}
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation uses spaces but this project is configured to use tabs for indentation (see .cfformat.json). The if block and its contents should be indented with tabs to match the project's formatting standards.

Suggested change
request.coldBoxVirtualApp.shutdown();
}
request.coldBoxVirtualApp.shutdown();
}

Copilot uses AI. Check for mistakes.

public void function onRequestEnd( required targetPage ) {
request.coldBoxVirtualApp.shutdown();
if ( request.keyExists( "coldBoxVirtualApp" ) ) {
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an extra space in the keyExists function call. It should be request.keyExists( "coldBoxVirtualApp" ) instead of request.keyExists( "coldBoxVirtualApp" ) to match the project's formatting standards which use single spaces for padding.

Suggested change
if ( request.keyExists( "coldBoxVirtualApp" ) ) {
if ( request.keyExists( "coldBoxVirtualApp" ) ) {

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant