From f0c0bd525150210c81b5a16ea0619426b7032cf5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20M=C3=BCller?= <thomas.mueller@tmit.eu>
Date: Sat, 19 Jul 2014 20:23:38 +0200
Subject: [PATCH] check if $tables is an array

---
 lib/repair/innodb.php | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/repair/innodb.php b/lib/repair/innodb.php
index 4d58bf64a9e..6f7fcfcd4c9 100644
--- a/lib/repair/innodb.php
+++ b/lib/repair/innodb.php
@@ -28,9 +28,11 @@ class InnoDB extends BasicEmitter implements \OC\RepairStep {
 		}
 
 		$tables = $this->getAllMyIsamTables($connection);
-		foreach ($tables as $table) {
-			$connection->exec("ALTER TABLE $table ENGINE=InnoDB;");
-			$this->emit('\OC\Repair', 'info', array("Fixed $table"));
+		if (is_array($tables)) {
+			foreach ($tables as $table) {
+				$connection->exec("ALTER TABLE $table ENGINE=InnoDB;");
+				$this->emit('\OC\Repair', 'info', array("Fixed $table"));
+			}
 		}
 	}
 
-- 
GitLab