From 12efa030fe1d3320954915db57853ee9c4189ab1 Mon Sep 17 00:00:00 2001 From: Jan Sundermeyer Date: Wed, 8 Jan 2025 18:15:44 +0100 Subject: [PATCH] fix #3936 --- src/latexparser/latexparsing.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/latexparser/latexparsing.cpp b/src/latexparser/latexparsing.cpp index 3aa291569..139281651 100644 --- a/src/latexparser/latexparsing.cpp +++ b/src/latexparser/latexparsing.cpp @@ -695,7 +695,7 @@ bool latexDetermineContexts2(QDocumentLineHandle *dlh, TokenStack &stack, Comman //lastComma = -1; lastEqual = level; level++; - if(lp->commandDefs.contains(commandStack.top().optionalCommandName + "/" + keyName)){ + if(!commandStack.isEmpty() && lp->commandDefs.contains(commandStack.top().optionalCommandName + "/" + keyName)){ // handle keyval values with normal commandStack mechanism (mandatory argument only!!) // allows argument classification CommandDescription cd = lp->commandDefs.value(commandStack.top().optionalCommandName + "/" + keyName);