Skip to content

Commit 1eea629

Browse files
authored
fix: if page closed !get child selectors
1 parent 6fa4f88 commit 1eea629

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server/src/workflow-management/selector.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2753,6 +2753,10 @@ export const getNonUniqueSelectors = async (page: Page, coordinates: Coordinates
27532753

27542754
export const getChildSelectors = async (page: Page, parentSelector: string): Promise<string[]> => {
27552755
try {
2756+
if (page.isClosed()) {
2757+
logger.debug('Page is closed, cannot get child selectors');
2758+
return [];
2759+
}
27562760
const childSelectors = await page.evaluate((parentSelector: string) => {
27572761
// Function to get a non-unique selector based on tag and class (if present)
27582762
function getNonUniqueSelector(element: HTMLElement): string {

0 commit comments

Comments
 (0)