diff --git a/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php b/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
index 9bcd5ba699..c5d49a2844 100644
--- a/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
+++ b/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
@@ -1047,11 +1047,13 @@ public function getValue() {
     $value = NULL;
     // Find the position of this argument within the view.
     $position = 0;
-    foreach ($this->view->argument as $id => $argument) {
-      if ($id == $this->options['id']) {
-        break;
+    if (is_array($this->view->argument)) {
+      foreach ($this->view->argument as $id => $argument) {
+        if ($id == $this->options['id']) {
+          break;
+        }
+        $position++;
       }
-      $position++;
     }
 
     $arg = isset($this->view->args[$position]) ? $this->view->args[$position] : NULL;
