Debugger: Fixed rare crash when opening debugger window

This commit is contained in:
Sour 2018-02-23 08:03:23 -05:00
parent 2b7c3b6198
commit 06cb78850f

View file

@ -1092,22 +1092,23 @@ namespace Mesen.GUI.Debugger
DebugInfo info = ConfigManager.Config.DebugInfo;
int lineIndex = (int)((_code._lineMemoryType.Count - 1) * position);
switch(_code._lineMemoryType[lineIndex]) {
case 'N': return _nesRamColor;
case 'P':
if(_code._unexecutedAddresses.Contains(lineIndex)) {
return info.CodeUnexecutedCodeColor;
} else if(_code._verifiedDataAddresses.Contains(lineIndex)) {
return info.CodeVerifiedDataColor;
} else if(_code._speculativeCodeAddreses.Contains(lineIndex)) {
return info.CodeUnidentifiedDataColor;
}
return Color.White;
if(lineIndex < _code._lineMemoryType.Count) {
switch(_code._lineMemoryType[lineIndex]) {
case 'N': return _nesRamColor;
case 'P':
if(_code._unexecutedAddresses.Contains(lineIndex)) {
return info.CodeUnexecutedCodeColor;
} else if(_code._verifiedDataAddresses.Contains(lineIndex)) {
return info.CodeVerifiedDataColor;
} else if(_code._speculativeCodeAddreses.Contains(lineIndex)) {
return info.CodeUnidentifiedDataColor;
}
return Color.White;
case 'W': return Color.LightSteelBlue;
case 'S': return Color.LightCoral;
case 'W': return Color.LightSteelBlue;
case 'S': return Color.LightCoral;
}
}
return Color.Transparent;
}