Skip to content

Commit

Permalink
fix(JobInfo): fix CheckArgumentsWithHandlers()
Browse files Browse the repository at this point in the history
  • Loading branch information
MingboPeng committed May 10, 2023
1 parent 1440b0f commit 4b1e7b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/PollinationSDK.Tests/TestInit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ public class TestInit
[OneTimeSetUp]
public void Init()
{
var useDevelopmentServer = false;
var useDevelopmentServer = true;
var key = string.Empty;

// for local development tests, you must add Api key to ApiKey.txt
var keyPath = useDevelopmentServer ? @"../../../ApiKey.txt" : @"../../../ApiKey_production.txt";

keyPath = System.IO.Path.GetFullPath(keyPath);
if (System.IO.File.Exists(keyPath))
key = System.IO.File.ReadAllText(keyPath);
else
Expand Down
4 changes: 2 additions & 2 deletions src/PollinationSDK/Wrapper/JobInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ public JobInfo Duplicate()
{
var pathArg = args.OfType<JobPathArgument>().FirstOrDefault(_ => _.Name == item.Name);
currentArg = pathArg;
currentValue = pathArg.Source;
currentValue = pathArg?.Source;
}
else
{
var valueArg = args.OfType<JobArgument>().FirstOrDefault(_ => _.Name == item.Name);
currentArg = valueArg;
currentValue = valueArg.Value;
currentValue = valueArg?.Value;
}

var processedData = InputArgumentValidator.CheckAndValidate(item, platform, currentValue, handlerChecker);
Expand Down

0 comments on commit 4b1e7b4

Please sign in to comment.