Commit f146520c authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Fix segfault when changing color of unexisting entity

parent 379dae5c
......@@ -203,6 +203,10 @@ void Settings_window::color_changed(string name, QTableWidget *table, const QCol
Session &S = Session::getSession();
Palette *p = S.get_palette(name, palette_name);
Color *old = p->get_color(state_name);
// Quick and dirty patch
if ( old == NULL ) {
old = new Color(1, 1, 1);
}
QColor q(old->get_red()*255, old->get_green()*255, old->get_blue()*255);
bool checked = qobject_cast<QCheckBox *>(table->cellWidget(row, 2))->checkState()== Qt::Checked;
......
Supports Markdown
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