diff --git a/src/Form/Expression/ContextFormTrait.php b/src/Form/Expression/ContextFormTrait.php
index 65aeacc..b99c8eb 100644
--- a/src/Form/Expression/ContextFormTrait.php
+++ b/src/Form/Expression/ContextFormTrait.php
@@ -108,7 +108,7 @@ trait ContextFormTrait {
    */
   protected function getContextConfigFromFormValues(FormStateInterface $form_state, array $context_definitions) {
     $context_config = ContextConfig::create();
-    foreach ($form_state->getValue('context') as $context_name => $value) {
+    foreach ($form_state->getValue('context', []) as $context_name => $value) {
       if ($form_state->get("context_$context_name") == 'selector') {
         $context_config->map($context_name, $value['setting']);
       }
