Nullability fixes

This commit is contained in:
shilangyu 2021-04-11 11:12:42 +02:00
parent 236301275d
commit c66b20a460
2 changed files with 3 additions and 3 deletions

View File

@ -41,9 +41,9 @@ extension on CommentSortType {
class CommentTree {
CommentView comment;
List<CommentTree> children;
List<CommentTree> children = [];
CommentTree(this.comment, [this.children = const []]);
CommentTree(this.comment);
/// takes raw linear comments and turns them into a CommentTree
static List<CommentTree> fromList(List<CommentView> comments) {

View File

@ -56,7 +56,7 @@ class InstancePage extends HookWidget {
padding: const EdgeInsets.all(8),
child: Text('ERROR: ${siteSnap.error}'),
)
] else if (siteSnap.data!.siteView == null)
] else if (siteSnap.hasData && siteSnap.data!.siteView == null)
const Text('ERROR')
else
const CircularProgressIndicator(semanticsLabel: 'loading')