Skip to content

Commit ea5211d

Browse files
committed
refactor codebase.
1 parent 40f903c commit ea5211d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/Webkul/Admin/src/Http/Controllers/User/SessionController.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Support\Collection;
77
use Illuminate\View\View;
88
use Webkul\Admin\Http\Controllers\Controller;
9+
use Webkul\Core\Menu\MenuItem;
910

1011
class SessionController extends Controller
1112
{
@@ -96,8 +97,12 @@ public function destroy(): RedirectResponse
9697
/**
9798
* Find menu item by URL.
9899
*/
99-
protected function findIntendedRoute(Collection $menus, string $url): ?object
100+
protected function findIntendedRoute(Collection $menus, ?string $url): ?MenuItem
100101
{
102+
if (is_null($url)) {
103+
return null;
104+
}
105+
101106
foreach ($menus as $menu) {
102107
if ($menu->getUrl() === $url) {
103108
return $menu;

0 commit comments

Comments
 (0)