From cc19783651b1094ab7834f5ae27d65b7341c13f1 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Tue, 10 Nov 2020 18:17:46 +0800 Subject: [PATCH] FIX code bug --- app/controllers/repositories_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index a54b17ffe..4df823131 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -81,8 +81,8 @@ class RepositoriesController < ApplicationController def commit @sha = params[:sha] - @commit = Gitea::Repository::Commits::GetService.call(@owner.login, @repository.identifier, @sha, current_user.gitea_token) - @commit_diff = Gitea::Repository::Commits::GetService.call(@owner.login, @repository.identifier, @sha, current_user.gitea_token, {diff: true}) + @commit = Gitea::Repository::Commits::GetService.call(@owner.login, @repository.identifier, @sha, current_user&.gitea_token) + @commit_diff = Gitea::Repository::Commits::GetService.call(@owner.login, @repository.identifier, @sha, current_user&.gitea_token, {diff: true}) end def tags