Merge pull request #661 from lbryio/trending-metrics
Fix checking length of endefined
This commit is contained in:
commit
51dd0c637f
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@ function logMetricsMiddleware(req, res, next) {
|
|||
|
||||
let referrer = req.get('referrer');
|
||||
|
||||
if(referrer.length > 255) {
|
||||
if(referrer && referrer.length > 255) {
|
||||
// Attempt to "safely" clamp long URLs
|
||||
referrer = /(.*?)#.*/.exec(referrer)[1];
|
||||
|
||||
|
|
Loading…
Reference in a new issue