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

Fixed crash in CheckSavedContents

This commit is contained in:
Brian Fiete 2020-10-01 14:43:19 -07:00
parent d9444cc603
commit f6c42b561a

View file

@ -862,14 +862,11 @@ namespace IDE.ui
public void CheckSavedContents() public void CheckSavedContents()
{ {
if (mEditData.mLastFileTextVersion == mEditWidget.Content.mData.mCurTextVersionId) if (((mEditData != null)) && (mEditData.mLastFileTextVersion == mEditWidget.Content.mData.mCurTextVersionId) && (mEditData.mRecoveryHash.IsZero))
{ {
if ((mEditData != null) && (mEditData.mRecoveryHash.IsZero)) String text = scope .();
{ mEditWidget.GetText(text);
String text = scope .(); mEditData.mRecoveryHash = MD5.Hash(.((uint8*)text.Ptr, text.Length));
mEditWidget.GetText(text);
mEditData.mRecoveryHash = MD5.Hash(.((uint8*)text.Ptr, text.Length));
}
} }
} }
@ -2782,7 +2779,9 @@ namespace IDE.ui
} }
if (mIsBinary) if (mIsBinary)
{
mEditWidget.mEditWidgetContent.mIsReadOnly = true; mEditWidget.mEditWidgetContent.mIsReadOnly = true;
}
} }
public bool Show(String filePath, bool silentFail = false, FileEditData fileEditData = null) public bool Show(String filePath, bool silentFail = false, FileEditData fileEditData = null)
@ -3327,7 +3326,7 @@ namespace IDE.ui
bool needsFreshLoad = mLoadFailed; bool needsFreshLoad = mLoadFailed;
if ((mEditData != null) && (!Path.Equals(mFilePath, mEditData.mFilePath))) if ((mEditData != null) && (!Path.Equals(mFilePath, mEditData.mFilePath)))
{ {
// This can happen if we do an Auto Find for source, which finds an incorrect file but then we Brose // This can happen if we do an Auto Find for source, which finds an incorrect file but then we Browse
// to the correct version // to the correct version
CloseEdit(); CloseEdit();
needsFreshLoad = true; needsFreshLoad = true;