Skip to content

Commit 815afb7

Browse files
jingyu525thilanga
authored andcommitted
fix: Call to a member function requestIsConditional() on null (dingo#1377)
* fix: Call to a member function requestIsConditional() on null * fix: delete old version, use new version
1 parent 4803112 commit 815afb7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Routing/Adapter/Lumen.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public function dispatch(Request $request, $version)
107107
$this->removeMiddlewareFromApp();
108108

109109
$routeCollector = $this->mergeOldRoutes($version);
110+
110111
$dispatcher = call_user_func($this->dispatcherResolver, $routeCollector);
111112

112113
$this->app->setDispatcher($dispatcher);

src/Routing/Router.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,10 @@ protected function mergeGroup(array $new, array $old)
402402
$new[$option] = $this->formatArrayBasedOption($option, $new);
403403
}
404404

405+
if (isset($new['version'])) {
406+
unset($old['version']);
407+
}
408+
405409
if (isset($new['domain'])) {
406410
unset($old['domain']);
407411
}
@@ -588,7 +592,7 @@ public function gatherRouteMiddlewares($route)
588592
*/
589593
protected function requestIsConditional()
590594
{
591-
return $this->getCurrentRoute()->requestIsConditional();
595+
return ($r = $this->getCurrentRoute()) ? $r->requestIsConditional() : false;
592596
}
593597

594598
/**

0 commit comments

Comments
 (0)