diff --git a/app/controllers/ontologies_controller.rb b/app/controllers/ontologies_controller.rb index 6fc48fa41..bdc90db40 100644 --- a/app/controllers/ontologies_controller.rb +++ b/app/controllers/ontologies_controller.rb @@ -255,7 +255,7 @@ def show # Note: find_by_acronym includes ontology views @ontology = LinkedData::Client::Models::Ontology.find_by_acronym(params[:ontology], include: 'all').first - not_found if @ontology.nil? + not_found if @ontology&.errors && [401, 403, 404].include?(@ontology&.status) # Handle the case where an ontology is converted to summary only. # See: https://github.com/ncbo/bioportal_web_ui/issues/133. diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 973fa9f64..3a024bc1f 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -18,6 +18,7 @@ def index def show @project = LinkedData::Client::Models::Project.get(params[:id]) + not_found if @project&.errors && @project.status == 404 @ontologies_used = [] onts_used = @project.ontologyUsed onts_used.each do |ont_used|