Explorar el Código

[Bugfix] Handle empty maintainers list

Foppe Hemminga hace 5 años
padre
commit
d742af2bfb
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      snippets.php

+ 4 - 2
snippets.php

@@ -21,8 +21,10 @@ if ( $screen == 0 ) {
 QUERY;
 QUERY;
 	$all_maintainers = [];
 	$all_maintainers = [];
 	$rows = $pdo->query($query);
 	$rows = $pdo->query($query);
-	foreach ($rows as $row) {
-		$all_maintainers[$row['maintainer']] = $row['value'];
+	if ( $rows ) {
+		foreach ($rows as $row) {
+			$all_maintainers[$row['maintainer']] = $row['value'];
+		}
 	}
 	}
 	$snippets[0] = <<<HTML
 	$snippets[0] = <<<HTML
 		<form>
 		<form>