Skip to content

Commit

Permalink
fix: properly checked for error array key
Browse files Browse the repository at this point in the history
Changes to be committed:
	modified:   src/Router.php
  • Loading branch information
IcyDrae committed Dec 27, 2020
1 parent 5dcd343 commit eea29a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private static function beforeHandle()

# Quickfix
# Need to detail the logic more, collect the route and find out where the error actually took place
if (self::$subRoute["error"]) {
if (!empty(self::$subRoute["error"])) {
header('Content-type:application/json;charset=utf-8');
http_response_code(400);
echo json_encode([
Expand All @@ -97,7 +97,7 @@ private static function beforeHandle()
$collector = new RouteCollector;
self::$parsed = $collector->addRoute($route, self::$request["uri"]);

if (self::$parsed["error"]) {
if (!empty(self::$parsed["error"])) {
header('Content-type:application/json;charset=utf-8');
http_response_code(400);
echo self::$parsed;
Expand Down

0 comments on commit eea29a5

Please sign in to comment.