From dc6a515f081cc1725f0ea993d373855d205d061b Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 10 Jan 2017 09:19:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=83=A8=E5=88=86=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E4=B8=8D=E6=AD=A3=E7=A1=AE=E6=8A=A5500=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E8=AE=A9=E5=85=B6=E8=B7=B3=E8=BD=AC=E8=87=B3?= =?UTF-8?q?404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/org_subfields_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb index 2b41983cc..e727912d3 100644 --- a/app/controllers/org_subfields_controller.rb +++ b/app/controllers/org_subfields_controller.rb @@ -51,7 +51,12 @@ class OrgSubfieldsController < ApplicationController @organization = Organization.find(params[:id]) else domain = Secdomain.where("subname=?", request.subdomain).first - @organization = Organization.find(domain.pid) + begin + @organization = Organization.find(domain.pid) + rescue + render_404 + return + end end if @organization.is_public? or User.current.admin? or User.current.member_of_org?(@organization) @org_subfield = OrgSubfield.find_by_sql("select distinct org_subfields.* from org_subfields,"+