OC_App::getStorage() failed if app dir didn't exist.

This commit is contained in:
Thomas Tanghus 2012-04-24 00:26:33 +02:00
parent dfc94cbe84
commit 6848b069c9
1 changed files with 4 additions and 0 deletions

View File

@ -519,6 +519,10 @@ class OC_App{
public static function getStorage($appid){
if(OC_App::isEnabled($appid)){//sanity check
if(OC_User::isLoggedIn()){
$view = new OC_FilesystemView('/'.OC_User::getUser());
if(!$view->file_exists($appid)) {
$view->mkdir($appid);
}
return new OC_FilesystemView('/'.OC_User::getUser().'/'.$appid);
}else{
OC_Log::write('core','Can\'t get app storage, app, user not logged in',OC_Log::ERROR);