package org.jenkinsci.plugins.github.pullrequest;

import hudson.Extension;
import hudson.model.AbstractProject;
import hudson.model.Action;
import hudson.model.TransientProjectActionFactory;

import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * @author Kanstantsin Shautsou
 */
@Extension
public class GitHubPRRepositoryFactory extends TransientProjectActionFactory {
    private final static Logger LOGGER = Logger.getLogger(GitHubPRRepositoryFactory.class.getName());

    @Override
    public Collection<? extends Action> createFor(AbstractProject project) {
        if (project.getTrigger(GitHubPRTrigger.class) != null) {
            return Collections.singleton(GitHubPRRepository.forProject(project));
        }

        return Collections.emptyList();
    }

}

@@ -659,24 +659,42 @@
  project) %7B%0A
+        try %7B%0A    
         if (
@@ -742,24 +742,28 @@
  != null) %7B%0A
+    
             
@@ -832,16 +832,179 @@
 ject));%0A
+            %7D%0A        %7D catch (Throwable t) %7B%0A            // bad configured project i.e. github project property wrong%0A            return Collections.emptyList();%0A
         

Allow save job that had no GH project property before.