diff --git a/violet/lib/pages/settings/login/ehentai_login.dart b/violet/lib/pages/settings/login/ehentai_login.dart index 581130d7d..c38416968 100644 --- a/violet/lib/pages/settings/login/ehentai_login.dart +++ b/violet/lib/pages/settings/login/ehentai_login.dart @@ -62,9 +62,11 @@ class _LoginScreenState extends State { Future _checkCookie() async { final controller = await _webViewController.future; - final cookieString = jsonDecode( - await controller.runJavascriptReturningResult('document.cookie')) - as String; + var cookieString = + await controller.runJavascriptReturningResult('document.cookie'); + try { + cookieString = jsonDecode(cookieString) as String; + } catch (e) {} final cookies = parseCookies(cookieString); developer.log('Get cookies: $cookies');