Index: branches/2.8.x/wb/framework/functions.php
===================================================================
--- branches/2.8.x/wb/framework/functions.php	(revision 1219)
+++ branches/2.8.x/wb/framework/functions.php	(revision 1220)
@@ -48,6 +48,7 @@
     }
 
     // Empty the folder
+	if (is_dir($directory)) {
     $dir = dir($directory);
     while (false !== $entry = $dir->read()) {
         // Skip pointers
@@ -66,6 +67,7 @@
     // Now delete the folder
     $dir->close();
     return rmdir($directory);
+	}
 }
 
 // Function to open a directory and add to a dir list
