diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 85c22e661..d8fdb601d 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -284,7 +284,7 @@ class ShixunsController < ApplicationController raise "sync failed" if @shixun.gpid.blank? rescue Exception => e @shixun.update_attribute(:gpid, nil) - if @repository.id + if @repository && @repository.id @repository.destroy end end diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index c5fa4876c..319fc9a4d 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -2,7 +2,7 @@