fix(browser): add null check for crawlerRunConfig.url

Add additional null check when accessing crawlerRunConfig.url in cookie configuration to prevent potential null pointer exceptions. Previously, the code only checked if crawlerRunConfig existed but not its url property.

Fixes potential runtime error when crawlerRunConfig.url is undefined.
This commit is contained in:
UncleCode
2025-04-10 23:25:07 +08:00
parent 66ac07b4f3
commit 7c358a1aee

View File

@@ -658,7 +658,7 @@ class BrowserManager:
"name": "cookiesEnabled",
"value": "true",
"url": crawlerRunConfig.url
if crawlerRunConfig
if crawlerRunConfig and crawlerRunConfig.url
else "https://crawl4ai.com/",
}
]