Commit 2b3549a44739b6c2e7b68be4f1d833ad68f7d654
Handle missing commit.id
Charles E. Lehner committed on 11/19/2020, 12:48:43 PMParent: 2e0f4754d77ef48d1fe5df444a5025a8f477a250
Files changed
lib/repos/index.js | changed |
lib/repos/index.js | ||
---|---|---|
@@ -622,21 +622,24 @@ | ||
622 | 622 … | if (!rev) return pull.empty() |
623 | 623 … | return u.readOnce(function (cb) { |
624 | 624 … | repo.getCommitParsed(rev, function (err, commit) { |
625 | 625 … | if (err) return cb(err) |
626 | - var commitPath = [repo.id, 'commit', commit.id] | |
626 … | + var commitId = typeof commit.id === 'string' && commit.id | |
627 … | + var commitPath = commitId && [repo.id, 'commit', commitId] | |
627 | 628 … | var actor = commit.separateAuthor ? 'author' : 'committer' |
628 | 629 … | var actionKey = actor.slice(0,1).toUpperCase() + actor.slice(1) + 'ReleasedCommit' |
629 | 630 … | cb(null, |
630 | 631 … | '<span>' + |
631 | 632 … | req._t(actionKey, { |
632 | 633 … | name: u.escape(commit[actor].name), |
633 | - commitName: u.link(commitPath, commit.title) | |
634 … | + commitName: commitPath | |
635 … | + ? u.link(commitPath, commit.title) | |
636 … | + : commit.title | |
634 | 637 … | }) + |
635 | 638 … | '</span>' + |
636 | 639 … | '<span class="float-right">' + |
637 | 640 … | req._t('LatestOn', { |
638 | - commitId: commit.id.slice(0, 7), | |
641 … | + commitId: commitId && commitId.slice(0, 7), | |
639 | 642 … | date: commit[actor].date.toLocaleString(req._locale) |
640 | 643 … | }) + |
641 | 644 … | '</span>' |
642 | 645 … | ) |
Built with git-ssb-web