Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Common/Api/LiveAlgorithmResultsJsonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
Datacenter = jObject.Value<string>("datacenter"),
Public = jObject.Value<bool>("public"),
Success = jObject.Value<bool>("success"),
Errors = jObject["errors"]?.ToObject<List<string>>()
Errors = jObject["errors"]?.ToObject<List<string>>() ?? new List<string>()
};

if (!liveAlgoResults.Success)
Expand Down
2 changes: 1 addition & 1 deletion Tests/Api/LiveAlgorithmResultsJsonConverterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void EveryFieldIsOptional()
Assert.IsFalse(result.Success);
Assert.IsNull(result.Status);
Assert.IsNull(result.DeployId);
Assert.IsNull(result.Errors);
CollectionAssert.IsEmpty(result.Errors, "Like every other response, a missing errors array reads as no errors");
Assert.IsNull(result.Stopped);
Assert.AreEqual(default(DateTime), result.Launched);
Assert.IsNull(result.Charts);
Expand Down
7 changes: 4 additions & 3 deletions Tests/Api/ProjectTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -930,11 +930,12 @@ public void CreatesLiveAlgorithm()
Assert.IsTrue(readLiveLogs.Length >= 0, "The length of the logs was negative!");
Assert.IsTrue(readLiveLogs.DeploymentOffset >= 0, "The deploymentOffset");
}
catch (Exception ex)
catch
{
// Delete the project in case of an error
// Stop whatever is running and delete the project in case of an error
ApiClient.LiquidateLiveAlgorithm(projectId);
Assert.IsTrue(ApiClient.DeleteProject(projectId).Success);
throw ex;
throw;
}

// Delete the project
Expand Down
Loading