diff --git a/desktop/browser_window.c b/desktop/browser_window.c index e79dcc1a6..bd8e32e64 100644 --- a/desktop/browser_window.c +++ b/desktop/browser_window.c @@ -4780,8 +4780,11 @@ browser_window_get_ssl_chain(struct browser_window *bw, int browser_window_get_cookie_count( const struct browser_window *bw) { - char *cookies = urldb_get_cookie(browser_window_access_url(bw), true); int count = 0; + char *cookies = urldb_get_cookie(browser_window_access_url(bw), true); + if (cookies == NULL) { + return 0; + } for (char *c = cookies; *c != '\0'; c++) { if (*c == ';')