Fix asan(address sanitizer) issue with no plugins

Fix #10470, close #10471
pull/10487/head
Christian Grasser 2021-08-31 07:06:28 +02:00 committed by Don Ho
parent 5c52aff7a1
commit ed5c2631c1
1 changed files with 8 additions and 5 deletions

View File

@ -928,14 +928,17 @@ void Notepad_plus::saveDockingParams()
else
floatCont = nppGUI._dockingData._pluginDockInfo[i]._prevContainer;
if (floatContArray[floatCont] == 0)
if (floatCont >= 0)
{
RECT rc;
if (nppGUI._dockingData.getFloatingRCFrom(floatCont, rc))
if (floatContArray[floatCont] == 0)
{
vFloatingWindowInfo.push_back(FloatingWindowInfo(floatCont, rc.left, rc.top, rc.right, rc.bottom));
RECT rc;
if (nppGUI._dockingData.getFloatingRCFrom(floatCont, rc))
{
vFloatingWindowInfo.push_back(FloatingWindowInfo(floatCont, rc.left, rc.top, rc.right, rc.bottom));
}
floatContArray[floatCont] = 1;
}
floatContArray[floatCont] = 1;
}
if (i < nppGUI._dockingData._pluginDockInfo.size()) // to prevent from crash in debug mode
vPluginDockInfo.push_back(nppGUI._dockingData._pluginDockInfo[i]);