浏览代码

[Bugfix] Handle empty maintainers list

Foppe Hemminga 5 年之前
父节点
当前提交
d742af2bfb
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      snippets.php

+ 4 - 2
snippets.php

@@ -21,8 +21,10 @@ if ( $screen == 0 ) {
 QUERY;
 	$all_maintainers = [];
 	$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
 		<form>