Skip to content

Commit f71f524

Browse files
committed
Release improvements
1 parent 77c7445 commit f71f524

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

Runtime/Common/ClientPathHelper.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,12 @@ private static string GenerateFullPath(this string path)
7373
internal static bool IsFileInDatabaseDirectory(string databasePath, string filePath)
7474
{
7575
// If databasePath does not have a trailing slash, it is already a directory.
76-
if (!databasePath.EndsWith("/")) {
77-
return databasePath == Path.GetDirectoryName(filePath);
78-
}
79-
// Handles case when users put a trailing slash in their database path
80-
return Path.GetDirectoryName(databasePath) == Path.GetDirectoryName(filePath);
76+
if (!databasePath.EndsWith("/"))
77+
{
78+
return new DirectoryInfo(databasePath).FullName == new DirectoryInfo(Path.GetDirectoryName(filePath)).FullName;
79+
}
80+
// Handles case when users put a trailing slash in their database path
81+
return Path.GetDirectoryName(databasePath) == Path.GetDirectoryName(filePath);
8182
}
8283
}
8384
}

Runtime/Model/Breadcrumbs/Storage/BacktraceStorageLogManager.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ public BacktraceStorageLogManager(string storagePath)
104104
/// <returns>true if breadcrumbs file was created. Otherwise false.</returns>
105105
public bool Enable()
106106
{
107+
if (currentSize != 0)
108+
{
109+
return true;
110+
}
107111
try
108112
{
109113
if (BreadcrumbFile.Exists())
@@ -116,6 +120,7 @@ public bool Enable()
116120
_breadcrumbStream.Write(StartOfDocument, 0, StartOfDocument.Length);
117121
_breadcrumbStream.Write(EndOfDocument, 0, EndOfDocument.Length);
118122
}
123+
_emptyFile = true;
119124
currentSize = StartOfDocument.Length + EndOfDocument.Length;
120125
}
121126
catch (Exception e)
@@ -136,6 +141,11 @@ public bool Enable()
136141
/// <returns>True if breadcrumb was stored in the breadcrumbs file. Otherwise false.</returns>
137142
public bool Add(string message, BreadcrumbLevel level, UnityEngineLogLevel type, IDictionary<string, string> attributes)
138143
{
144+
// file is not initialized
145+
if (currentSize == 0)
146+
{
147+
return false;
148+
}
139149
byte[] bytes;
140150
lock (_lockObject)
141151
{

Runtime/Native/Windows/NativeClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private void HandleNativeCrashes(IDictionary<string, string> clientAttributes, I
132132

133133
foreach (var attribute in clientAttributes)
134134
{
135-
AddNativeAttribute(attribute.Key, attribute.Value);
135+
AddNativeAttribute(attribute.Key, attribute.Value == null ? string.Empty : attribute.Value);
136136
}
137137

138138
// add exception type to crashes handled by crashpad - all exception handled by crashpad

0 commit comments

Comments
 (0)