Add some null pointer checks (#5130)
* Fix some null pointer uses * fix bad merge
This commit is contained in:
parent
113f8de9b1
commit
aeb9da337e
1 changed files with 11 additions and 5 deletions
|
@ -1998,7 +1998,10 @@ static void VBlankCB_PokeStorage(void)
|
||||||
ProcessSpriteCopyRequests();
|
ProcessSpriteCopyRequests();
|
||||||
UnkUtil_Run();
|
UnkUtil_Run();
|
||||||
TransferPlttBuffer();
|
TransferPlttBuffer();
|
||||||
SetGpuReg(REG_OFFSET_BG2HOFS, sStorage->bg2_X);
|
if (sStorage != NULL)
|
||||||
|
{
|
||||||
|
SetGpuReg(REG_OFFSET_BG2HOFS, sStorage->bg2_X);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CB2_PokeStorage(void)
|
static void CB2_PokeStorage(void)
|
||||||
|
@ -4206,11 +4209,14 @@ static void StopFlashingCloseBoxButton(void)
|
||||||
|
|
||||||
static void UpdateCloseBoxButtonFlash(void)
|
static void UpdateCloseBoxButtonFlash(void)
|
||||||
{
|
{
|
||||||
if (sStorage->closeBoxFlashing && ++sStorage->closeBoxFlashTimer > 30)
|
if (sStorage != NULL)
|
||||||
{
|
{
|
||||||
sStorage->closeBoxFlashTimer = 0;
|
if (sStorage->closeBoxFlashing && ++sStorage->closeBoxFlashTimer > 30)
|
||||||
sStorage->closeBoxFlashState = (sStorage->closeBoxFlashState == FALSE);
|
{
|
||||||
UpdateCloseBoxButtonTilemap(sStorage->closeBoxFlashState);
|
sStorage->closeBoxFlashTimer = 0;
|
||||||
|
sStorage->closeBoxFlashState = (sStorage->closeBoxFlashState == FALSE);
|
||||||
|
UpdateCloseBoxButtonTilemap(sStorage->closeBoxFlashState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue