mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2025-01-09 22:55:09 +08:00
Add null checks for name hashing to help avoid crashes for some resources
This commit is contained in:
parent
8998b8c808
commit
a12ccd6947
@ -288,7 +288,7 @@ namespace CodeWalker.GameFiles
|
||||
{ }
|
||||
|
||||
NameHash = _CMapTypes.name;
|
||||
if (NameHash == 0)
|
||||
if ((NameHash == 0) && (entry.NameLower != null))
|
||||
{
|
||||
int ind = entry.NameLower.LastIndexOf('.');
|
||||
if (ind > 0)
|
||||
|
@ -57,6 +57,7 @@ namespace CodeWalker.GameFiles
|
||||
|
||||
public static uint GenHash(string text)
|
||||
{
|
||||
if (text == null) return 0;
|
||||
uint h = 0;
|
||||
for (int i = 0; i < text.Length; i++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user