diff --git a/AltoRouter.php b/AltoRouter.php index 5bd63b3..31aa338 100644 --- a/AltoRouter.php +++ b/AltoRouter.php @@ -204,7 +204,7 @@ public function match($requestUrl = null, $requestMethod = null) $requestUrl = substr($requestUrl, 0, $strpos); } - $lastRequestUrlChar = $requestUrl[strlen($requestUrl)-1]; + $lastRequestUrlChar = $requestUrl ? $requestUrl[strlen($requestUrl)-1] : ''; // set Request Method if it isn't passed as a parameter if ($requestMethod === null) {