mirror of https://github.com/Washi1337/Emux.git
Safety around ReadBytes
This commit is contained in:
parent
a0ea8010df
commit
999e670ba1
|
@ -58,6 +58,9 @@ namespace Emux.GameBoy.Cartridge
|
||||||
|
|
||||||
public void ReadBytes(int address, byte[] buffer, int offset, int length)
|
public void ReadBytes(int address, byte[] buffer, int offset, int length)
|
||||||
{
|
{
|
||||||
|
if (memoryStream == null)
|
||||||
|
return;
|
||||||
|
|
||||||
memoryStream.Position = address;
|
memoryStream.Position = address;
|
||||||
memoryStream.Read(buffer, offset, length);
|
memoryStream.Read(buffer, offset, length);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue