[gtk/wip/baedert/for-master: 166/180] print-editor: Fix a wrong comparison




commit e8a182515812003a4da0e51297c145cf45fb55bb
Author: Timm Bäder <mail baedert org>
Date:   Thu Oct 15 06:05:39 2020 +0200

    print-editor: Fix a wrong comparison
    
    If error is NULL, replacing the file contents worked and we don't
    show the error dialog. The previous version pretty explicitly
    dereferenced a NULL pointer by first ensuring that error is NULL and
    then accessing error->message.
    
    Found by scan-build

 demos/print-editor/print-editor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/demos/print-editor/print-editor.c b/demos/print-editor/print-editor.c
index 416ff9db31..a0c8da320d 100644
--- a/demos/print-editor/print-editor.c
+++ b/demos/print-editor/print-editor.c
@@ -164,7 +164,7 @@ save_file (GFile *save_filename)
                            NULL,
                            &error);
 
-  if (error != NULL)
+  if (error == NULL)
     {
       if (save_filename != filename)
        {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]