From 20ca39bf2a2a53ace278cb86dac1baead22e63a6 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Sun, 19 Apr 2020 16:06:45 +1000 Subject: [PATCH] Ensure content exists before adding it --- lib/custom_wizard/builder.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/custom_wizard/builder.rb b/lib/custom_wizard/builder.rb index 6084ad5f..a44b1192 100644 --- a/lib/custom_wizard/builder.rb +++ b/lib/custom_wizard/builder.rb @@ -256,8 +256,8 @@ class CustomWizard::Builder with_type: true } ).perform - - if content[:type] == 'association' + + if content && content[:type] == 'association' content[:result] = content[:result].map do |item| { id: item[:key],