[metacity] display: add NULL check to fix coverity defect



commit 103d6b281227959ba6bf041e6df47f7282d8e9b4
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Mon Mar 15 16:18:40 2021 +0200

    display: add NULL check to fix coverity defect
    
    Coverity is right that window might be null but does not know that
    grab_op is not moving operation.
    
    Coverity CID: #1445663

 src/core/display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 75db10a86..ff909a62a 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -3578,7 +3578,7 @@ meta_display_begin_grab_op (MetaDisplay *display,
   /* If we're trying to move a window, move the first
    * non-attached dialog instead.
    */
-  if (meta_grab_op_is_moving (op))
+  if (window != NULL && meta_grab_op_is_moving (op))
     grab_window = get_first_freefloating_window (window);
 
   /* FIXME:


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