]> source.dussan.org Git - gitea.git/commitdiff
Fix dashboard commit status null access (#30771) (#30786)
authorGiteabot <teabot@gitea.io>
Tue, 30 Apr 2024 12:53:20 +0000 (20:53 +0800)
committerGitHub <noreply@github.com>
Tue, 30 Apr 2024 12:53:20 +0000 (20:53 +0800)
Backport #30771 by wxiaoguang

Fix #30768

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
web_src/js/components/DashboardRepoList.vue

index 2d980a1b180ab1293a14b75bd803158e6ddb001f..8bce40ee790a960a1d45778f4892684b721cf0fa 100644 (file)
@@ -251,9 +251,9 @@ const sfc = {
         this.repos = json.data.map((webSearchRepo) => {
           return {
             ...webSearchRepo.repository,
-            latest_commit_status_state: webSearchRepo.latest_commit_status.State,
+            latest_commit_status_state: webSearchRepo.latest_commit_status?.State, // if latest_commit_status is null, it means there is no commit status
+            latest_commit_status_state_link: webSearchRepo.latest_commit_status?.TargetURL,
             locale_latest_commit_status_state: webSearchRepo.locale_latest_commit_status,
-            latest_commit_status_state_link: webSearchRepo.latest_commit_status.TargetURL,
           };
         });
         const count = response.headers.get('X-Total-Count');