Skip to content

Commit

Permalink
Fix exception if running locally or on unsupported build server
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Aug 11, 2019
1 parent 6bd78de commit c238244
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Cake.Issues.Recipe/Content/data/IssuesData.cake
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ public class IssuesData

/// <summary>
/// Gets the build server under which the build is running.
/// Returns <c>null</c> if running locally or on an unsupported build server.
/// </summary>
public IIssuesBuildServer BuildServer { get; }

/// <summary>
/// Gets the pull request system used for the code.
/// Returns <c>null</c> if not running a pull request build or on an unsupported build server.
/// </summary>
public IIssuesPullRequestSystem PullRequestSystem { get; }

Expand Down Expand Up @@ -55,10 +57,13 @@ public class IssuesData
this.RepositoryRootDirectory = context.MakeAbsolute(context.Directory("./"));

this.BuildServer = DetermineBuildServer(context);
this.PullRequestSystem =
DeterminePullRequestSystem(
context,
BuildServer.DetermineRepositoryRemoteUrl(context, this.RepositoryRootDirectory));
if (this.BuildServer != null)
{
this.PullRequestSystem =
DeterminePullRequestSystem(
context,
BuildServer.DetermineRepositoryRemoteUrl(context, this.RepositoryRootDirectory));
}
}

/// <summary>
Expand Down

0 comments on commit c238244

Please sign in to comment.