* temp fix to prevent crashing while doing wild folder changing / cancelling actions
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Fri, 15 Jun 2007 14:26:03 +0000 (14:26 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Fri, 15 Jun 2007 14:26:03 +0000 (14:26 +0000)
pmo-trunk-r2260

src/modest-mail-operation.c

index f24b1f5..6676eec 100644 (file)
@@ -1,4 +1,3 @@
-
 /* Copyright (c) 2006, Nokia Corporation
  * All rights reserved.
  *
@@ -435,7 +434,17 @@ modest_mail_operation_clone_state (ModestMailOperation *self)
        ModestMailOperationState *state;
        ModestMailOperationPrivate *priv;
 
+       /* FIXME: this should be fixed properly
+        * 
+        * in some cases, priv was NULL, so checking here to
+        * make sure.
+        */
+       g_return_val_if_fail (self, NULL);
        priv = MODEST_MAIL_OPERATION_GET_PRIVATE (self);
+       g_return_val_if_fail (priv, NULL);
+
+       if (!priv)
+               return NULL;
 
        state = g_slice_new (ModestMailOperationState);