mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-06 18:08:36 +00:00
Fix NULL Crash on ReferenceToIndex (#2311)
Some checks are pending
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (clang, clang++, ubuntu-latest, linux) (push) Waiting to run
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (clang-14, clang++-14, ubuntu-22.04, linux) (push) Waiting to run
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (msvc, windows-latest, win) (push) Waiting to run
hl2sdk-mock tests / mock (push) Waiting to run
Some checks are pending
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (clang, clang++, ubuntu-latest, linux) (push) Waiting to run
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (clang-14, clang++-14, ubuntu-22.04, linux) (push) Waiting to run
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (msvc, windows-latest, win) (push) Waiting to run
hl2sdk-mock tests / mock (push) Waiting to run
This commit is contained in:
parent
2a25025d2e
commit
f7e51b6110
@ -1102,7 +1102,7 @@ int CHalfLife2::ReferenceToIndex(cell_t entRef)
|
|||||||
|
|
||||||
CEntInfo *pInfo = LookupEntity(hndl.GetEntryIndex());
|
CEntInfo *pInfo = LookupEntity(hndl.GetEntryIndex());
|
||||||
|
|
||||||
if (pInfo->m_SerialNumber != hndl.GetSerialNumber())
|
if (!pInfo || pInfo->m_SerialNumber != hndl.GetSerialNumber())
|
||||||
{
|
{
|
||||||
return INVALID_EHANDLE_INDEX;
|
return INVALID_EHANDLE_INDEX;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user