Skip to content

Commit 20d90f0

Browse files
committed
Save empty strings as 'CIRILLA_EMPTY_STRING'
This doesn't change anything in the GMD loading code, it only changes how Cirilla.Core saves empty strings added by the user.
1 parent 143698a commit 20d90f0

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

Cirilla.Core/Cirilla.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
5-
<Version>0.0.4</Version>
5+
<Version>0.0.4.1</Version>
66
<Authors>Fusion86</Authors>
77
<Company />
88
</PropertyGroup>

Cirilla.Core/Models/GMD.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,16 @@ public void Save(string path)
160160

161161
foreach (var item in Strings)
162162
{
163-
if (item == null) continue;
164-
165-
bw.Write(ExEncoding.UTF8.GetBytes(item));
166-
bw.Write((byte)0); // szString end of string
163+
if (String.IsNullOrEmpty(item))
164+
{
165+
bw.Write(ExEncoding.UTF8.GetBytes("CIRILLA_EMPTY_STRING"));
166+
bw.Write((byte)0); // szString end of string
167+
}
168+
else
169+
{
170+
bw.Write(ExEncoding.UTF8.GetBytes(item));
171+
bw.Write((byte)0); // szString end of string
172+
}
167173
}
168174
}
169175

0 commit comments

Comments
 (0)