Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Bruno Garcia <bruno@brunogarcia.com>
  • Loading branch information
vaind and bruno-garcia authored Apr 19, 2022
1 parent ce4cd4c commit 9f82cd5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 1 addition & 3 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,7 @@ Related: https://forum.unity.com/threads/6572-debugger-agent-unable-to-listen-on
</Target>

<!-- Run smoke test on the WebGL player: dotnet msbuild /t:UnitySmokeTestPlayerWebGL src/Sentry.Unity -->
<Target Name="UnitySmokeTestPlayerWebGL" DependsOnTargets="FindUnity" Condition="'$(MSBuildProjectName)' == 'Sentry.Unity'">
<Error Condition="$(UnityRoot) == ''" Text="Couldn't find Unity."></Error>

<Target Name="UnitySmokeTestPlayerWebGL" Condition="'$(MSBuildProjectName)' == 'Sentry.Unity'">
<Exec Command="python3 -X utf8 &quot;$(RepoRoot)/scripts/smoke-test-webgl.py&quot;" IgnoreStandardErrorWarningFormat="true"/>
</Target>

Expand Down
3 changes: 2 additions & 1 deletion samples/unity-of-bugs/Assets/Scripts/SmokeTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ public string GetMessage(int index)
public bool CheckMessage(int index, String substring)
{
#if UNITY_WEBGL
// Note: we cannot use the standard checks on WebGL - it would get stuck here because of the lack of multi-threading
// Note: we cannot use the standard checks on WebGL - it would get stuck here because of the lack of multi-threading.
// The verification is done in the python script used for WebGL smoke test
return true;
#else
var message = GetMessage(index);
Expand Down
8 changes: 3 additions & 5 deletions src/Sentry.Unity/UnityWebRequestTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ internal class UnityWebRequestTransport : HttpTransportBase

public UnityWebRequestTransport(SentryUnityOptions options)
: base(options)
{
_options = options;
}
=> _options = options;

// adapted HttpTransport.SendEnvelopeAsync()
internal IEnumerator SendEnvelopeAsync(Envelope envelope)
Expand All @@ -56,7 +54,7 @@ internal IEnumerator SendEnvelopeAsync(Envelope envelope)
yield return www.SendWebRequest();

var response = GetResponse(www);
if (response != null)
if (response is not null)
{
HandleResponse(response, processedEnvelope);
}
Expand Down Expand Up @@ -107,7 +105,7 @@ private UnityWebRequest CreateWebRequest(HttpRequestMessage message)
foreach (var header in www.GetResponseHeaders())
{
// Unity would throw if we tried to set content-type or content-length
if (header.Key != "content-length" && header.Key != "content-type")
if (header.Key is not "content-length" && header.Key is not "content-type")
{
response.Headers.Add(header.Key, header.Value);
}
Expand Down

0 comments on commit 9f82cd5

Please sign in to comment.