mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-15 02:24:04 +00:00
fix(search): 🐛 more robust null check for description
This commit is contained in:
parent
7bd30ebecb
commit
1e47e95a8d
|
@ -75,8 +75,13 @@ function convertDataToResults( data ) {
|
|||
case 'textextracts':
|
||||
return item.extract || '';
|
||||
case 'pagedescription':
|
||||
/* eslint-disable-next-line es-x/no-symbol-prototype-description */
|
||||
return item.pageprops.description.slice( 0, 60 ) + '...' || '';
|
||||
/* eslint-disable es-x/no-symbol-prototype-description */
|
||||
if ( item.pageprops && item.pageprops.description ) {
|
||||
return item.pageprops.description.slice( 0, 60 ) + '...';
|
||||
/* eslint-enable es-x/no-symbol-prototype-description */
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue