changeset 4367:99b6e2bac92a

write window positions to config only when windows are valid
author mf0102 <0102@gmx.at>
date Tue, 25 Mar 2008 17:53:41 +0100
parents 1f900d7b737b
children 8ca25aee5037
files src/audacious/bmpconfig.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/bmpconfig.c	Tue Mar 25 17:46:06 2008 +0100
+++ b/src/audacious/bmpconfig.c	Tue Mar 25 17:53:41 2008 +0100
@@ -635,7 +635,8 @@
     /* FIXME: we're looking up SkinnedWindow::x &c ourselves here.
      * this isn't exactly right. -nenolod
      */
-    if ( SKINNED_WINDOW(playlistwin)->x != -1 &&
+    if ( playlistwin &&
+         SKINNED_WINDOW(playlistwin)->x != -1 &&
          SKINNED_WINDOW(playlistwin)->y != -1 )
     {
         cfg_db_set_int(db, NULL, "playlist_x",
@@ -644,7 +645,8 @@
                            SKINNED_WINDOW(playlistwin)->y);
     }
     
-    if ( SKINNED_WINDOW(mainwin)->x != -1 &&
+    if ( mainwin &&
+         SKINNED_WINDOW(mainwin)->x != -1 &&
          SKINNED_WINDOW(mainwin)->y != -1 )
     {
         cfg_db_set_int(db, NULL, "player_x",
@@ -653,7 +655,8 @@
                            SKINNED_WINDOW(mainwin)->y);
     }
 
-    if ( SKINNED_WINDOW(equalizerwin)->x != -1 &&
+    if ( equalizerwin &&
+         SKINNED_WINDOW(equalizerwin)->x != -1 &&
          SKINNED_WINDOW(equalizerwin)->y != -1 )
     {
         cfg_db_set_int(db, NULL, "equalizer_x",