From 7c358a1aee209eb6a79074307f6fe6a2068050af Mon Sep 17 00:00:00 2001 From: UncleCode Date: Thu, 10 Apr 2025 23:25:07 +0800 Subject: [PATCH] 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. --- crawl4ai/browser_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl4ai/browser_manager.py b/crawl4ai/browser_manager.py index 7fc819e0..f3c7d861 100644 --- a/crawl4ai/browser_manager.py +++ b/crawl4ai/browser_manager.py @@ -658,7 +658,7 @@ class BrowserManager: "name": "cookiesEnabled", "value": "true", "url": crawlerRunConfig.url - if crawlerRunConfig + if crawlerRunConfig and crawlerRunConfig.url else "https://crawl4ai.com/", } ]