(MESS) fixed gameboy crash on exit when mounted cart wasn't valid (nw)

This commit is contained in:
Oliver Stöneberg 2013-02-14 20:00:58 +00:00
parent 2558a614e8
commit 347cb338f8

View file

@ -415,7 +415,7 @@ bool megaduck_cart_slot_device::call_load()
void base_gb_cart_slot_device::call_unload()
{
if (m_cart->get_ram_size() && m_cart->get_has_battery())
if (m_cart && m_cart->get_ram_size() && m_cart->get_has_battery())
battery_save(m_cart->get_ram_base(), m_cart->get_ram_size());
}