Skip to content

Commit d407e0f

Browse files
committed
handle index not found
1 parent c52ef39 commit d407e0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

GeometryDashAPI/Data/GameData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public virtual async Task LoadAsync(string fileName)
3838

3939
var xor = Crypt.XOR(data, 0xB);
4040
var index = xor.AsSpan().IndexOf((byte)0);
41-
var gZipDecompress = Crypt.GZipDecompress(GameConvert.FromBase64(Encoding.ASCII.GetString(xor, 0, index)));
41+
var gZipDecompress = Crypt.GZipDecompress(GameConvert.FromBase64(Encoding.ASCII.GetString(xor, 0, index >= 0 ? index : xor.Length)));
4242

4343
DataPlist = new Plist(Encoding.ASCII.GetBytes(gZipDecompress));
4444
}

0 commit comments

Comments
 (0)