1
0
mirror of https://github.com/git-touch/git-touch synced 2024-12-13 17:08:49 +01:00

fix: handle commit user null

This commit is contained in:
Rongjian Zhang 2019-02-18 18:54:06 +08:00
parent 1b3ce07bb7
commit cc8ea1d39a

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 '),