Commit f1366148 authored by Alexander Semke's avatar Alexander Semke
Browse files

Don't crash when calling the context menu of a rendered markdown entry.

parent f796bb7b
...@@ -402,7 +402,10 @@ void WorksheetEntry::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) ...@@ -402,7 +402,10 @@ void WorksheetEntry::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
void WorksheetEntry::populateMenu(QMenu* menu, QPointF pos) void WorksheetEntry::populateMenu(QMenu* menu, QPointF pos)
{ {
auto* firstAction = menu->actions().first(); QAction* firstAction = nullptr;
if (!menu->actions().isEmpty()) //action() can be empty, s.a. WorksheetTextItem::populateMenu() where this function is called
firstAction = menu->actions().first();
QAction* action; QAction* action;
if (!worksheet()->isRunning() && wantToEvaluate()) if (!worksheet()->isRunning() && wantToEvaluate())
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment