Index: metacity/ChangeLog
===================================================================
RCS file: /export/cvs/gnome-2.0/metacity/ChangeLog,v
retrieving revision 1.716
diff -p -u -5 -r1.716 ChangeLog
--- metacity/ChangeLog	2003/08/21 04:32:10	1.716
+++ metacity/ChangeLog	2003/08/27 12:10:55
@@ -1,5 +1,12 @@
+2003-08-27  Arvind Samptur  <arvind.samptur@wipro.com>
+
+	* src/stack.c (meta_window_set_stack_position) :
+	Check if window exists before altering the stack position
+	in the sorted list
+	Fixes #120809
+
 2003-08-20  Rob Adams  <robadams@ucla.edu>
 
 	Complete the transition to using the MRU window as the default
 	focus window instead of the topmost window; fixes a number of
 	problems with sloppy focus and utility windows.  See #112031.
Index: metacity/src/stack.c
===================================================================
RCS file: /export/cvs/gnome-2.0/metacity/src/stack.c,v
retrieving revision 1.67
diff -p -u -5 -r1.67 stack.c
--- metacity/src/stack.c	2003/08/19 20:10:45	1.67
+++ metacity/src/stack.c	2003/08/27 12:10:55
@@ -1550,11 +1550,11 @@ meta_window_set_stack_position (MetaWind
   tmp = window->screen->stack->sorted;
   while (tmp != NULL)
     {
       MetaWindow *w = tmp->data;
 
-      if (w->stack_position >= low &&
+      if (w && w->stack_position >= low &&
           w->stack_position <= high)
         w->stack_position += delta;
 
       tmp = tmp->next;
     }
