projects
/
xboard.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
c1d1ad8
)
Make preview resistent to nothing being selected
author
H.G.Muller
<hgm@hgm-xboard.(none)>
Wed, 20 Apr 2016 21:56:31 +0000 (23:56 +0200)
committer
H.G.Muller
<hgm@hgm-xboard.(none)>
Wed, 20 Apr 2016 21:56:31 +0000 (23:56 +0200)
The name of the selected file could be a null pointer, and ScaleOnePiece
does not like that for a pieceImageDirectory.
gtk/xoptions.c
patch
|
blob
|
history
diff --git
a/gtk/xoptions.c
b/gtk/xoptions.c
index
a12a050
..
f64a2d5
100644
(file)
--- a/
gtk/xoptions.c
+++ b/
gtk/xoptions.c
@@
-1110,9
+1110,11
@@
BrowseCallback (GtkFileChooser *chooser, gpointer data)
char *name = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(chooser));
Option *opt = currentOption + (int)(intptr_t) data;
int n = (int) (intptr_t) opt->choice;
- Preview(n, name);
- messedUp = TRUE;
- if(name) g_free(name);
+ if(name) {
+ Preview(n, name);
+ messedUp = TRUE;
+ g_free(name);
+ }
return FALSE;
}