From 099fc52e00ab8158b81e0037cade22f73f0c07dd Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 20 Jan 2022 09:42:55 +0800 Subject: [PATCH] fix: contributor error rescue --- app/controllers/repositories_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index e83bd0e79..c42051e0b 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -150,7 +150,8 @@ class RepositoriesController < ApplicationController if params[:filepath].present? || @project.educoder? @contributors = [] else - @contributors = Gitea::Repository::Contributors::GetService.call(@owner, @repository.identifier) + result = Gitea::Repository::Contributors::GetService.call(@owner, @repository.identifier) + @contributors = result.is_a?(Hash) && result.key?(:status) ? [] : result end rescue @contributors = []