diff --git a/modules/video_embed_wysiwyg/tests/src/Functional/TextFormatConfigurationTest.php b/modules/video_embed_wysiwyg/tests/src/Functional/TextFormatConfigurationTest.php
index acfc2e6..3f565f2 100644
--- a/modules/video_embed_wysiwyg/tests/src/Functional/TextFormatConfigurationTest.php
+++ b/modules/video_embed_wysiwyg/tests/src/Functional/TextFormatConfigurationTest.php
@@ -74,6 +74,14 @@ class TextFormatConfigurationTest extends BrowserTestBase {
       'editor[settings][toolbar][button_groups]' => '[[{"name":"Group","items":["video_embed"]}]]',
     ], t('Save configuration'));
     $this->assertSession()->pageTextContains('The text format Plain text has been updated.');
+
+    // Test the messages aren't triggered if they are in the second row.
+    $this->drupalGet($this->formatUrl);
+    $this->submitForm([
+      'filters[video_embed_wysiwyg][status]' => TRUE,
+      'editor[settings][toolbar][button_groups]' => '[[{"name":"Foo","items":["NumberedList"]}],[{"name":"Bar","items":["video_embed"]}]]',
+    ], t('Save configuration'));
+    $this->assertSession()->pageTextContains('The text format Plain text has been updated.');
   }
 
   /**
diff --git a/modules/video_embed_wysiwyg/video_embed_wysiwyg.module b/modules/video_embed_wysiwyg/video_embed_wysiwyg.module
index 51fcee5..71bc01a 100644
--- a/modules/video_embed_wysiwyg/video_embed_wysiwyg.module
+++ b/modules/video_embed_wysiwyg/video_embed_wysiwyg.module
@@ -32,13 +32,15 @@ function video_embed_wysiwyg_form_filter_format_form_alter(&$form, $form_state,
 function video_embed_wysiwyg_toolbar_filter_validate($form, FormStateInterface $form_state) {
   $filter_enabled = !empty($form_state->getValue(['filters', 'video_embed_wysiwyg', 'status']));
   $button_enabled = FALSE;
-  $button_groups = json_decode($form_state->getValue(['editor', 'settings', 'toolbar', 'button_groups']), TRUE);
-  if (!empty($button_groups[0])) {
-    foreach ($button_groups[0] as $button_group) {
-      foreach ($button_group['items'] as $item) {
-        if ($item === 'video_embed') {
-          $button_enabled = TRUE;
-          break 2;
+  $button_rows = json_decode($form_state->getValue(['editor', 'settings', 'toolbar', 'button_groups']), TRUE);
+  if (!empty($button_rows)) {
+    foreach ($button_rows as $button_row) {
+      foreach ($button_row as $button_group) {
+        foreach ($button_group['items'] as $item) {
+          if ($item === 'video_embed') {
+            $button_enabled = TRUE;
+            break 2;
+          }
         }
       }
     }
