From ff9824011a2af7b8e1b6be24aa40a9cd716d1cf2 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 16 Apr 2021 13:08:06 +0100 Subject: [PATCH] Fix crash when non iterable options property given to picker --- packages/bbui/src/Form/Core/Picker.svelte | 37 ++++++++++++----------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/packages/bbui/src/Form/Core/Picker.svelte b/packages/bbui/src/Form/Core/Picker.svelte index b78ff6fb02..4fb6c27acc 100644 --- a/packages/bbui/src/Form/Core/Picker.svelte +++ b/packages/bbui/src/Form/Core/Picker.svelte @@ -68,23 +68,26 @@ {/if} - {#each options as option} -
  • onSelectOption(getOptionValue(option))}> - {getOptionLabel(option)} - -
  • - {/each} + {#if options && Array.isArray(options)} + {#each options as option} +
  • onSelectOption(getOptionValue(option))}> + {getOptionLabel(option)} + +
  • + {/each} + {/if} {/if}