mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-15 18:26:15 +01:00
Check if href exists before accessing it (#5281)
I got a lot of errors in Firefox 50 `TypeError: $(...).attr(...) is undefined nodebb.min.js:25167:24` which points exactly to that line I’ve changed. Since HTML5 `href` is not a required attribute of an `a` tag. We have a couple of links without `href` and every time you click it you will get this error.
This commit is contained in:
committed by
Julian Lam
parent
1c6cee207f
commit
b1a48981ef
@@ -366,7 +366,7 @@ $(document).ready(function () {
|
||||
}
|
||||
|
||||
// Default behaviour for rss feeds
|
||||
if (internalLink && $(this).attr('href').endsWith('.rss')) {
|
||||
if (internalLink && $(this).attr('href') && $(this).attr('href').endsWith('.rss')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user