Skip to content

Commit 4660ae9

Browse files
committed
fixed check user existence
1 parent 51424f6 commit 4660ae9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/controllers/LfmController.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class LfmController extends Controller {
1717
public $file_location = null;
1818
public $dir_location = null;
1919
public $file_type = null;
20-
20+
protected $user;
2121

2222
/**
2323
* Constructor
@@ -38,6 +38,7 @@ public function __construct()
3838

3939
$this->checkDefaultFolderExists('user');
4040
$this->checkDefaultFolderExists('share');
41+
$this->user = \Auth::user();
4142
}
4243

4344

@@ -80,8 +81,8 @@ private function formatLocation($location, $type = null, $get_thumb = false)
8081
{
8182
if ($type === 'share') {
8283
return $location . Config::get('lfm.shared_folder_name');
83-
} elseif ($type === 'user') {
84-
return $location . \Auth::user()->user_field;
84+
} elseif ($type === 'user' && $this->user) {
85+
return $location .$this->user->field_id;
8586
}
8687

8788
$working_dir = Input::get('working_dir');

0 commit comments

Comments
 (0)