1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 12:02:21 +02:00

Fixed moreinfo hover crash with no source location

This commit is contained in:
Brian Fiete 2022-05-29 12:07:47 -07:00
parent 087a129007
commit c080f1cbb1
2 changed files with 4 additions and 6 deletions

View file

@ -1118,9 +1118,7 @@ namespace IDE
{ {
int32 charIdx = int32.Parse(loc).GetValueOrDefault(); int32 charIdx = int32.Parse(loc).GetValueOrDefault();
var fileEditData = GetEditData(cmds[1]); var fileEditData = GetEditData(cmds[1]);
if (fileEditData == null) fileEditData?.mEditWidget?.mEditWidgetContent.GetLineCharAtIdx(charIdx, out line, out lineChar);
break;
fileEditData.mEditWidget.mEditWidgetContent.GetLineCharAtIdx(charIdx, out line, out lineChar);
} }
ShowSourceFileLocation(cmds[1], -1, -1, line, lineChar, .Smart, true); ShowSourceFileLocation(cmds[1], -1, -1, line, lineChar, .Smart, true);
case "ShowCodeAddr": case "ShowCodeAddr":

View file

@ -5697,11 +5697,11 @@ namespace IDE.ui
for (var moreInfo in bestError.mMoreInfo) for (var moreInfo in bestError.mMoreInfo)
{ {
if (moreInfo.mLine != -1) if (moreInfo.mLine != -1)
{
showMouseoverString.AppendF("\n@{}\t{}:{}\t{}", moreInfo.mFilePath, moreInfo.mLine, moreInfo.mColumn, moreInfo.mError); showMouseoverString.AppendF("\n@{}\t{}:{}\t{}", moreInfo.mFilePath, moreInfo.mLine, moreInfo.mColumn, moreInfo.mError);
} else if (moreInfo.mFilePath != null)
else
showMouseoverString.AppendF("\n@{0}\t{1}\t{2}", moreInfo.mFilePath, moreInfo.mSrcStart, moreInfo.mError); showMouseoverString.AppendF("\n@{0}\t{1}\t{2}", moreInfo.mFilePath, moreInfo.mSrcStart, moreInfo.mError);
else
showMouseoverString.AppendF("\n{}", moreInfo.mError);
} }
} }
} }