fix: handle commit user null

This commit is contained in:
Rongjian Zhang 2019-02-18 18:54:06 +08:00
parent 1b3ce07bb7
commit cc8ea1d39a
1 changed files with 4 additions and 1 deletions

View File

@ -36,6 +36,7 @@ class TimelineItem extends StatelessWidget {
Expanded(
child: RichText(
text: TextSpan(style: TextStyle(color: Colors.black), children: [
// TODO: actor is null
createUserSpan(actor),
textSpan,
// TextSpan(text: ' ' + TimeAgo.formatFromString(item['createdAt']))
@ -83,7 +84,9 @@ class TimelineItem extends StatelessWidget {
// common types
case 'Commit':
return _buildItem(
actor: item['author']['user']['login'],
actor: item['author']['user'] == null
? null
: item['author']['user']['login'],
iconData: Octicons.git_commit,
textSpan: TextSpan(children: [
TextSpan(text: ' added commit '),