From 770abd3fcc7baf91a74e9adab7cbeef9c8a43d05 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Sat, 29 Aug 2015 12:06:56 -0600 Subject: [PATCH] Fix an error that could occur during upgrades. This will make the upgrade from older versions a little easier. --- resources/switch.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/switch.php b/resources/switch.php index ff873d1ca7..3db53a71d6 100644 --- a/resources/switch.php +++ b/resources/switch.php @@ -79,8 +79,9 @@ function load_extensions() { $sql .= " and e.enabled = 'true' "; $sql .= "order by "; $sql .= " e.extension asc "; - $result = $db->query($sql)->fetchAll(PDO::FETCH_ASSOC); - if (count($result) > 0) { + $query = $pdo->query($sql); + if($query !== false) { + $result = $db->query($sql)->fetchAll(PDO::FETCH_ASSOC); $x = 0; foreach($result as $row) { $destination = $row['extension'];