Skip to content

Commit

Permalink
More falsey assertion fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cdupuis committed May 17, 2019
1 parent 5221c92 commit 1ab04f8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class MergeActionContributor extends AbstractIdentifiableContribution
public supports(node: any): boolean {
if (node.baseBranchName) {
const pr = node as graphql.PullRequestToPullRequestLifecycle.PullRequest;
return pr.state === "open" && (pr.reviews === undefined || !pr.reviews.some(r => r.state !== "approved"));
return pr.state === "open" && (!pr.reviews || !pr.reviews.some(r => r.state !== "approved"));
} else {
return false;
}
Expand Down Expand Up @@ -122,9 +122,9 @@ export class MergeActionContributor extends AbstractIdentifiableContribution
message,
};
}
if (repo.allowMergeCommit === undefined
&& repo.allowSquashMerge === undefined
&& repo.allowRebaseMerge === undefined) {
if (!repo.allowMergeCommit
&& !repo.allowSquashMerge
&& !repo.allowRebaseMerge) {
mergeMethods.merge = {
method: "Merge",
title,
Expand Down

0 comments on commit 1ab04f8

Please sign in to comment.