From 18c936be9dde7d3d3fbea6d5be4f6b3b64e056cf Mon Sep 17 00:00:00 2001 From: NanZhang Date: Thu, 23 Nov 2023 10:54:29 +0800 Subject: [PATCH] fix: handle deployed_type_script with matching code_hash (#1512) --- app/controllers/api/v2/scripts_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v2/scripts_controller.rb b/app/controllers/api/v2/scripts_controller.rb index f3bdfdfb9..41347a4d9 100644 --- a/app/controllers/api/v2/scripts_controller.rb +++ b/app/controllers/api/v2/scripts_controller.rb @@ -40,7 +40,7 @@ def get_script_content deployed_cells = @contract.deployed_cell_outputs if deployed_cells.present? deployed_type_script = deployed_cells[0].type_script - if deployed_type_script.code_hash == Settings.type_id_code_hash + if deployed_type_script && deployed_type_script.code_hash == Settings.type_id_code_hash type_id = deployed_type_script.script_hash end end