소스 검색

[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>