FIX: Don't try to sync a commit if it's not present in the main repo. (#29)

FIX: Don’t try to sync a commit if it’s not present in the main repo. (#29)

Example here

If someone opens a PR to merge a fork’s commit into the main repo, and someone comments on the commit instead of the PR, the plugin won’t be able to find it.

diff --git a/lib/discourse_code_review/importer.rb b/lib/discourse_code_review/importer.rb
index d4d4155..e2f0f1b 100644
--- a/lib/discourse_code_review/importer.rb
+++ b/lib/discourse_code_review/importer.rb
@@ -53,6 +53,7 @@ module DiscourseCodeReview
     def sync_commit_sha(commit_sha)
       commit = github_repo.commit(commit_sha)
+      return if commit.nil?

GitHub sha: c78e203f

This commit appears in #29 which was approved by eviltrout. It was merged by romanrizzi.