Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
vite
Commits
f146520c
Commit
f146520c
authored
Nov 02, 2014
by
Mathieu Faverge
Browse files
Fix segfault when changing color of unexisting entity
parent
379dae5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/interface/Settings_window.cpp
View file @
f146520c
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment