Mentions légales du service

Skip to content
Snippets Groups Projects
Commit f7bb9368 authored by Johnny Jazeix's avatar Johnny Jazeix
Browse files

prevent crashes when opening the plugins window and no trace is loaded

parent 2b41608b
No related branches found
No related tags found
1 merge request!41Work/bump standards
......@@ -807,6 +807,12 @@ void Interface_graphic::on_about_triggered(){
void Interface_graphic::on_show_plugins_triggered()
{
// Don't open the window if no trace is loaded.
// This avoids crashes when the plugin does not check if the trace is valid
if( _core->get_trace() == nullptr ) {
return;
}
if(_plugin_window == nullptr) { //Creation of the window
_plugin_window = new Plugin_window( _core, this );
}
......@@ -814,11 +820,11 @@ void Interface_graphic::on_show_plugins_triggered()
if( _core->get_trace() != nullptr ) {
_plugin_window->update_trace();
}
if( _core->get_render() != nullptr ) {
_plugin_window->update_render();
}
_plugin_window->show();
}
......
......@@ -50,7 +50,6 @@
#include <sstream>
/* -- */
#include <QTreeWidgetItem>
#include <QGLWidget>
#include <QTextEdit>
#include <QPushButton>
#include <QRadioButton>
......
......@@ -11,7 +11,6 @@
/* -- */
#include <QFileDialog> // To choose the file to save
#include <QKeyEvent>
#include <QGLWidget>
#include <QGraphicsLayout>
/* -- */
#include "common/common.hpp"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment