fix: 专栏解析失败时白屏

This commit is contained in:
orz12
2024-02-29 20:53:41 +08:00
parent 8273ab4f99
commit 47e8747e1c

View File

@@ -41,11 +41,10 @@ class HtmlHttp {
String opusContent =
opusDetail.querySelector('.opus-module-content')!.innerHtml;
String? test;
try {
test = opusDetail
.querySelector('.horizontal-scroll-album__pic__img')!
.innerHtml;
} catch (_) {}
test = opusDetail
.querySelector('.horizontal-scroll-album__pic__img')
?.innerHtml ??
'';
String commentId = opusDetail
.querySelector('.bili-comment-container')!
@@ -96,7 +95,7 @@ class HtmlHttp {
//
String opusContent =
opusDetail.querySelector('#read-article-holder')!.innerHtml;
opusDetail.querySelector('#read-article-holder')?.innerHtml ?? '';
RegExp digitRegExp = RegExp(r'\d+');
Iterable<Match> matches = digitRegExp.allMatches(id);
String number = matches.first.group(0)!;