Index: /trunk/src/VBox/Main/src-server/MediumImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/MediumImpl.cpp	(revision 76238)
+++ /trunk/src/VBox/Main/src-server/MediumImpl.cpp	(revision 76239)
@@ -9087,9 +9087,11 @@
              * (chain->parent() is source's parent). Depth check above. */
             pTarget->i_deparent();
-            if (task.NotifyAboutChanges())
-                pMediumsForNotify.insert(task.mParentForTarget);
             pTarget->i_setParent(task.mParentForTarget);
             if (task.mParentForTarget)
+            {
                 i_deparent();
+                if (task.NotifyAboutChanges())
+                    pMediumsForNotify.insert(task.mParentForTarget);
+            }
 
             /* then, register again */
Index: /trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/SnapshotImpl.cpp	(revision 76238)
+++ /trunk/src/VBox/Main/src-server/SnapshotImpl.cpp	(revision 76239)
@@ -1791,4 +1791,6 @@
                 MediumAttachment *pAttach = *it;
                 Medium *pMedium = pAttach->i_getMedium();
+                if (!pMedium)
+                    continue;
 
                 bool fFound = false;
@@ -2285,4 +2287,6 @@
                 MediumAttachment *pAttach = *it;
                 Medium *pMedium = pAttach->i_getMedium();
+                if (!pMedium)
+                    continue;
 
                 bool fFound = false;
