X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fchimara-glk.c;h=4d8b55249fd6b3f2136e3daf9e34141481b10bee;hb=df5a5656a19699e1ea628f9149fe1b88ad3a0015;hp=ca01f44510d7c7dd86a0db2fa9698385cea1197b;hpb=b91a55deea444aec60612971666071c58c5ec014;p=projects%2Fchimara%2Fchimara.git diff --git a/libchimara/chimara-glk.c b/libchimara/chimara-glk.c index ca01f44..4d8b552 100644 --- a/libchimara/chimara-glk.c +++ b/libchimara/chimara-glk.c @@ -1063,8 +1063,9 @@ chimara_glk_set_css_from_file(ChimaraGlk *glk, const gchar *filename, GError **e int fd = open(filename, O_RDONLY); if(fd == -1) { - *error = g_error_new(G_IO_ERROR, g_io_error_from_errno(errno), - _("Error opening file \"%s\": %s"), filename, g_strerror(errno)); + if(error) + *error = g_error_new(G_IO_ERROR, g_io_error_from_errno(errno), + _("Error opening file \"%s\": %s"), filename, g_strerror(errno)); return FALSE; } @@ -1074,8 +1075,9 @@ chimara_glk_set_css_from_file(ChimaraGlk *glk, const gchar *filename, GError **e scan_css_file(scanner, glk); if(close(fd) == -1) { - *error = g_error_new(G_IO_ERROR, g_io_error_from_errno(errno), - _("Error closing file \"%s\": %s"), filename, g_strerror(errno)); + if(error) + *error = g_error_new(G_IO_ERROR, g_io_error_from_errno(errno), + _("Error closing file \"%s\": %s"), filename, g_strerror(errno)); return FALSE; } return TRUE;