Check for NULL sfont in fluid_handle_fonts

Closes ticket #139.
This commit is contained in:
Jai Veer 2015-05-12 15:03:30 +05:30 committed by David Henningsson
parent 048c51c4ab
commit 2cc0d0ea17
1 changed files with 8 additions and 3 deletions

View File

@ -695,9 +695,14 @@ fluid_handle_fonts(fluid_synth_t* synth, int ac, char** av, fluid_ostream_t out)
for (i = 0; i < num; i++) {
sfont = fluid_synth_get_sfont(synth, i);
fluid_ostream_printf(out, "%2d %s\n",
fluid_sfont_get_id(sfont),
fluid_sfont_get_name(sfont));
if (sfont) {
fluid_ostream_printf(out, "%2d %s\n",
fluid_sfont_get_id(sfont),
fluid_sfont_get_name(sfont));
}
else {
fluid_ostream_printf(out, "sfont is \"NULL\" for index %d\n", i);
}
}
return 0;