Skip to content

Commit

Permalink
Add element null value handling logics
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Lu-none committed Sep 6, 2023
1 parent 04618db commit 42cf15f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/src/connector/score_connector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ScoreConnector {
ConnectorParameter parameter;
String result;
Document tagNode;
Element tableNode, scoreNode;
Element scoreNode;
List<Element> scoreNodes, rankNodes;
List<SemesterCourseScoreJson> courseScoreList = [];
try {
Expand All @@ -86,8 +86,9 @@ class ScoreConnector {

//依照學期取得課程資料
for (final h3Node in h3Nodes) {
if (h3Node.nextElementSibling.localName != "table") continue;
tableNode = h3Node.nextElementSibling;
final siblingOfH3 = h3Node.nextElementSibling;
if (siblingOfH3 == null || siblingOfH3.localName != "table") continue;
final tableNode = siblingOfH3;

SemesterCourseScoreJson courseScore = SemesterCourseScoreJson();

Expand Down

0 comments on commit 42cf15f

Please sign in to comment.