Fix assumption that savedata->vf is non-null within flash memory code

This commit is contained in:
Jeffrey Pfau 2014-10-11 15:46:59 -07:00
parent d87081e6bc
commit 2bca4c399b
1 changed files with 3 additions and 1 deletions

View File

@ -343,7 +343,9 @@ void _flashSwitchBank(struct GBASavedata* savedata, int bank) {
savedata->currentBank = &savedata->data[bank << 16];
if (bank > 0) {
savedata->type = SAVEDATA_FLASH1M;
savedata->vf->truncate(savedata->vf, SIZE_CART_FLASH1M);
if (savedata->vf) {
savedata->vf->truncate(savedata->vf, SIZE_CART_FLASH1M);
}
}
}