diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 55b82fbd9d68a60082cc778cdb4d8e53733c2ef8..158376ea49e74bf3fad989bd6cf2a28f950bc6c2 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -807,7 +807,7 @@ class installer_base {
 		
 		$content = rf("tpl/apache_ispconfig.conf.master");
 		$records = $this->db->queryAllRecords("SELECT * FROM server_ip WHERE server_id = ".$conf["server_id"]." AND virtualhost = 'y'");
-		if(count($records) > 0) {
+		if(is_array($records) && count($records) > 0) {
 			foreach($records as $rec) {
 				$content .= "NameVirtualHost ".$rec["ip_address"].":80\n";
 				$content .= "NameVirtualHost ".$rec["ip_address"].":443\n";