nodebb-plugin-mentions 4.8.12 → 4.8.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/library.js +1 -1
  2. package/package.json +1 -1
package/library.js CHANGED
@@ -487,7 +487,7 @@ Mentions.parseRaw = async (content, type = 'default') => {
487
487
 
488
488
  replacements = Array.from(replacements)
489
489
  .sort((a, b) => {
490
- return b.user.userslug.length - a.user.userslug.length;
490
+ return b.user && a.user ? b.user.userslug.length - a.user.userslug.length : 0;
491
491
  })
492
492
  .forEach(({ match, url, user, mentionType }) => {
493
493
  const regex = isLatinMention.test(match) ?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-mentions",
3
- "version": "4.8.12",
3
+ "version": "4.8.13",
4
4
  "description": "NodeBB Plugin that allows users to mention other users by prepending an '@' sign to their username",
5
5
  "main": "library.js",
6
6
  "repository": {