Skip to content

Commit

Permalink
Closes issue #99 Undefined index error
Browse files Browse the repository at this point in the history
  • Loading branch information
treffynnon committed Jan 30, 2013
1 parent 38590e8 commit 7a43f5d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion idiorm.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ public static function for_table($table_name, $connection_name = self::DEFAULT_C
*/
protected static function _setup_db($connection_name = self::DEFAULT_CONNECTION)
{
if (!is_object(self::$_db[$connection_name])) {
if (!array_key_exists($connection_name, self::$_db) ||
!is_object(self::$_db[$connection_name])) {
self::_setup_db_config($connection_name);

$db = new PDO(
Expand Down

0 comments on commit 7a43f5d

Please sign in to comment.