From 48e85cb07866fd733d862b91d71293b216b12f25 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 13 Feb 2020 15:29:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/examination_banks/show.json.jbuilder | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/examination_banks/show.json.jbuilder b/app/views/examination_banks/show.json.jbuilder index 2a2da9af9..187e89cc2 100644 --- a/app/views/examination_banks/show.json.jbuilder +++ b/app/views/examination_banks/show.json.jbuilder @@ -40,7 +40,9 @@ json.exam do json.all_questions_count @items.size json.discipline do - json.(@exam.sub_discipline&.discipline, :id, :name) + if @exam.sub_discipline&.discipline.present? + json.(@exam.sub_discipline&.discipline, :id, :name) + end end json.sub_discipline do json.(@exam.sub_discipline, :id, :name)