Skip to content

Commit

Permalink
address an no element exception
Browse files Browse the repository at this point in the history
  • Loading branch information
devoncarew committed Nov 20, 2024
1 parent 52e4ceb commit 19f994b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkgs/sdk_triage_bot/lib/triage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,16 @@ Future<void> triage(
String? lastComment;
if (issue.hasComments) {
final comments = await githubService.fetchIssueComments(sdkSlug, issue);
final comment = comments.last;

lastComment = '''
final comment = comments.lastOrNull;
if (comment != null) {
lastComment = '''
---
Here is the last comment on the issue (by user @${comment.user?.login}):
${trimmedBody(comment.body ?? '')}
''';
}
}

// decide if we should triage
Expand Down

0 comments on commit 19f994b

Please sign in to comment.