Follow up to rev 972: Fix a AV / nil reference to ActiveSynMemo in popupQuery.OnPopup which is called when a shortcut is used (fx F9 to execute a query).

This commit is contained in:
Ansgar Becker
2007-10-02 18:05:52 +00:00
parent 93eb8003c3
commit d32b3efd1b

View File

@@ -4121,6 +4121,13 @@ begin
// Check on which memo the menu was popped up
ActiveSynMemo := TSynMemo( TPopupMenu(Sender).PopupComponent );
// When a shortcut from popupQuery is used, this procedure is
// also called, which then leads to PopupComponent being nil.
// However, this procedure only changes visible things in popupQuery,
// so we only need to run it if the popup is really displayed.
if ActiveSynMemo = nil then
Exit;
// Depending which SynMemo is focused, (de-)activate some menuitems
// The popupQuery is used in both Filter- and Query-Memo
InQueryMemo := ActiveSynMemo = SynMemoQuery;