Skip to content

Commit

Permalink
Merge pull request #5 from sunxiaoguang/fix_nill_pointer_dereference
Browse files Browse the repository at this point in the history
Check nil pointer before dereference
  • Loading branch information
kaishuu0123 committed Jul 23, 2023
2 parents 7ecfd09 + c89d178 commit c570c3e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chibisnes/cartridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,7 @@ func (cartridge *Cartridge) writeHiROM(bank byte, addr uint16, value byte) {
}

func (cartridge *Cartridge) Close() {
cartridge.ram.Close()
if cartridge.ram != nil {
cartridge.ram.Close()
}
}

0 comments on commit c570c3e

Please sign in to comment.