Fix crash when requesting disk usage without a target loaded. (bnc #396755)
authorMichael Andres <ma@suse.de>
Wed, 4 Jun 2008 12:57:49 +0000 (12:57 +0000)
committerMichael Andres <ma@suse.de>
Wed, 4 Jun 2008 12:57:49 +0000 (12:57 +0000)
package/libzypp.changes
zypp/DiskUsageCounter.cc

index 1551af7..5e422c2 100644 (file)
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Wed Jun  4 14:57:13 CEST 2008 - ma@suse.de
+
+- Fix crash when requesting disk usage without a target loaded. (bnc #396755) 
+- revision 10340
+
+-------------------------------------------------------------------
 Wed Jun  4 14:05:09 CEST 2008 - ma@suse.de
 
 - Fix memory corruption in curl media handler (bnc #396979) 
index 88ffa1b..159f3c0 100644 (file)
@@ -42,6 +42,13 @@ namespace zypp
     }
 
     sat::Pool satpool( sat::Pool::instance() );
+    if ( ! satpool.findSystemRepo() )
+    {
+      // take care we have at least an empty stystem repo.
+      // ::pool_calc_duchanges requires it.
+      satpool.systemRepo();
+      satpool.prepare();
+    }
 
     // init satsolver result vector with mountpoints
     static const ::DUChanges _initdu = { 0, 0, 0 };