From b0041492679f9ca3e9803b325f674c20c6bedd1e Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Mon, 23 Mar 2009 01:00:33 +0000 Subject: [PATCH] BUGFIX Check if the index_alt variable is set on the indexList() return before checking if it's an array git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73517 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/Database.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/model/Database.php b/core/model/Database.php index 04f84453c..29e5babbc 100755 --- a/core/model/Database.php +++ b/core/model/Database.php @@ -306,10 +306,12 @@ abstract class Database extends Object { $index_alt=DB::getConn()->modifyIndex($index, $spec); if(!$newTable) { - if(is_array($this->indexList[$table][$index_alt])) { - $array_spec = $this->indexList[$table][$index_alt]['spec']; - } else { - $array_spec = $this->indexList[$table][$index_alt]; + if(isset($this->indexList[$table][$index_alt])) { + if(is_array($this->indexList[$table][$index_alt])) { + $array_spec = $this->indexList[$table][$index_alt]['spec']; + } else { + $array_spec = $this->indexList[$table][$index_alt]; + } } }