From 8352fce964ccc5d21205ec8265a356c434ab456d Mon Sep 17 00:00:00 2001 From: Thea Choem <29684683+theachoem@users.noreply.github.com> Date: Sun, 15 Jan 2023 17:17:19 +0700 Subject: [PATCH] fix: nextLine getter null where no assertion (#1061) --- lib/src/models/documents/nodes/line.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/models/documents/nodes/line.dart b/lib/src/models/documents/nodes/line.dart index 3e3bbb04..4b6db80f 100644 --- a/lib/src/models/documents/nodes/line.dart +++ b/lib/src/models/documents/nodes/line.dart @@ -381,7 +381,7 @@ class Line extends Container { } final remaining = len - local; - if (remaining > 0) { + if (remaining > 0 && nextLine != null) { final rest = nextLine!.collectStyle(0, remaining); _handle(rest); } @@ -416,7 +416,7 @@ class Line extends Container { // TODO: add line style and parent's block style final remaining = len - local; - if (remaining > 0) { + if (remaining > 0 && nextLine != null) { final rest = nextLine!.collectAllIndividualStyles(0, remaining, beg: local); result.addAll(rest); @@ -450,7 +450,7 @@ class Line extends Container { } final remaining = len - local; - if (remaining > 0) { + if (remaining > 0 && nextLine != null) { final rest = nextLine!.collectAllStyles(0, remaining); result.addAll(rest); } @@ -501,7 +501,7 @@ class Line extends Container { } } - if (_len > 0) { + if (_len > 0 && nextLine != null) { _len = nextLine!._getPlainText(0, _len, plainText); } }