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




commit bc683a345c3482eba943c3031ab2b7fcb09b761d
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]