Skip to content

Commit 7062ffe

Browse files
committed
fix CreateWorldInternal return value
1 parent 9e57276 commit 7062ffe

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/extension.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ const char* StripperCS2::GetLicense()
185185

186186
const char* StripperCS2::GetVersion()
187187
{
188-
return "1.0.1";
188+
return "1.0.2";
189189
}
190190

191191
const char* StripperCS2::GetDate()

src/hook.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ namespace Hook
7272

7373
CSingleWorldRep* Detour_CreateWorldInternal(IWorldRendererMgr* pThis, CSingleWorldRep* singleWorld)
7474
{
75-
g_pCreateWorldInternal(pThis, singleWorld);
75+
// The world can fail to be created and the function will return nullptr.
76+
if (!g_pCreateWorldInternal(pThis, singleWorld))
77+
return nullptr;
7678

7779
auto pWorld = singleWorld->m_pCWorld;
7880

0 commit comments

Comments
 (0)