mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2025-01-25 06:52:53 +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;
|
NameHash = _CMapTypes.name;
|
||||||
if (NameHash == 0)
|
if ((NameHash == 0) && (entry.NameLower != null))
|
||||||
{
|
{
|
||||||
int ind = entry.NameLower.LastIndexOf('.');
|
int ind = entry.NameLower.LastIndexOf('.');
|
||||||
if (ind > 0)
|
if (ind > 0)
|
||||||
|
@ -57,6 +57,7 @@ namespace CodeWalker.GameFiles
|
|||||||
|
|
||||||
public static uint GenHash(string text)
|
public static uint GenHash(string text)
|
||||||
{
|
{
|
||||||
|
if (text == null) return 0;
|
||||||
uint h = 0;
|
uint h = 0;
|
||||||
for (int i = 0; i < text.Length; i++)
|
for (int i = 0; i < text.Length; i++)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user