File count technically can't exceed uint.MaxValue/2 elements...

lua-bytecode
Icedream 2014-10-23 02:28:05 +02:00
parent 499dfb7c36
commit 5ffdbcbbb3
1 changed files with 2 additions and 0 deletions

View File

@ -291,11 +291,13 @@ namespace GarrysMod.AddonCreator.Addon
sw.Write(Version); sw.Write(Version);
// File list // File list
#if SUPPORT_BIG
if (Files.Count > uint.MaxValue) if (Files.Count > uint.MaxValue)
{ {
throw new IndexOutOfRangeException("Number of addon files must not exceed " + uint.MaxValue + throw new IndexOutOfRangeException("Number of addon files must not exceed " + uint.MaxValue +
" elements."); " elements.");
} }
#endif
uint fileNum = 0; uint fileNum = 0;
foreach (var file in resultingFiles) foreach (var file in resultingFiles)
{ {