@@ -221,17 +221,19 @@ class RepoScreen extends StatelessWidget {
221
221
TableView (
222
222
hasIcon: true ,
223
223
items: [
224
- TableViewItem (
225
- leftIconData: Octicons .code,
226
- text: Text ('Code' ),
227
- rightWidget:
228
- Text (filesize ((payload['diskUsage' ] as int ) * 1000 )),
229
- screenBuilder: (_) => ObjectScreen (
230
- owner: owner,
231
- name: name,
232
- branch: payload['defaultBranchRef' ]['name' ], // FIXME: null
224
+ if (payload['defaultBranchRef' ] != null )
225
+ TableViewItem (
226
+ leftIconData: Octicons .code,
227
+ text: Text ('Code' ),
228
+ rightWidget:
229
+ Text (filesize ((payload['diskUsage' ] as int ) * 1000 )),
230
+ screenBuilder: (_) => ObjectScreen (
231
+ owner: owner,
232
+ name: name,
233
+ branch: payload['defaultBranchRef' ]
234
+ ['name' ], // FIXME: null
235
+ ),
233
236
),
234
- ),
235
237
if (payload['hasIssuesEnabled' ] as bool )
236
238
TableViewItem (
237
239
leftIconData: Octicons .issue_opened,
@@ -255,14 +257,15 @@ class RepoScreen extends StatelessWidget {
255
257
TableView (
256
258
hasIcon: true ,
257
259
items: [
258
- TableViewItem (
259
- leftIconData: Octicons .history,
260
- text: Text ('Commits' ),
261
- rightWidget: Text (numberFormat.format (
262
- payload['defaultBranchRef' ]['target' ]['history' ]
263
- ['totalCount' ])),
264
- screenBuilder: (_) => CommitsScreen (owner, name),
265
- ),
260
+ if (payload['defaultBranchRef' ] != null )
261
+ TableViewItem (
262
+ leftIconData: Octicons .history,
263
+ text: Text ('Commits' ),
264
+ rightWidget: Text (numberFormat.format (
265
+ payload['defaultBranchRef' ]['target' ]['history' ]
266
+ ['totalCount' ])),
267
+ screenBuilder: (_) => CommitsScreen (owner, name),
268
+ ),
266
269
TableViewItem (
267
270
leftIconData: Octicons .law,
268
271
text: Text ('License' ),
0 commit comments