mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
+fix: crash on accessing UndoRedo selection history while instance has not been initialized.
This commit is contained in:
parent
48d008c181
commit
6cb00e36d2
@ -7390,18 +7390,19 @@ void RestoreSelectionAction(int token, DoAction doAct)
|
||||
|
||||
int UndoRedoSelectionMap(int token, UndoRedoSelection_t* selection)
|
||||
{
|
||||
if (UndoRedoSelectionUTArray == NULL)
|
||||
return -1;
|
||||
|
||||
static unsigned int iTokenCnt = 0;
|
||||
|
||||
|
||||
// indexing is unsigned
|
||||
unsigned int utoken = (token >= 0) ? (unsigned int)token : 0U;
|
||||
|
||||
if (selection == NULL) {
|
||||
// reset / clear
|
||||
SendMessage(hwndEdit,SCI_EMPTYUNDOBUFFER,0,0);
|
||||
if (UndoRedoSelectionUTArray != NULL) {
|
||||
utarray_clear(UndoRedoSelectionUTArray);
|
||||
utarray_init(UndoRedoSelectionUTArray,&UndoRedoSelection_icd);
|
||||
}
|
||||
utarray_clear(UndoRedoSelectionUTArray);
|
||||
utarray_init(UndoRedoSelectionUTArray,&UndoRedoSelection_icd);
|
||||
iTokenCnt = 0U;
|
||||
return -1;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user