Bugfix: Don’t crash when the font is specified after the workspace names in configfile (Thanks xiaodong)

This commit is contained in:
Michael Stapelberg
2009-08-07 15:48:13 +02:00
parent 7cdaa1b277
commit 6192975a04
2 changed files with 11 additions and 2 deletions

View File

@ -41,7 +41,9 @@ void workspace_set_name(Workspace *ws, const char *name) {
FREE(ws->name);
ws->name = convert_utf8_to_ucs2(label, &(ws->name_len));
ws->text_width = predict_text_width(global_conn, config.font, ws->name, ws->name_len);
if (config.font != NULL)
ws->text_width = predict_text_width(global_conn, config.font, ws->name, ws->name_len);
else ws->text_width = 0;
free(label);
}