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