Fix error in gr-limited-text
gr-limited-text.js:66 Uncaught (in promise) TypeError: Cannot read property 'length' of null Change-Id: Iba8c7d832e7a0e6460d67f9c6fa26ed9bdc05469
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
* enabled.
|
||||
*/
|
||||
_updateTitle(text, limit) {
|
||||
this.hasTooltip = !!limit && text.length > limit;
|
||||
this.hasTooltip = !!limit && !!text && text.length > limit;
|
||||
if (this.hasTooltip) {
|
||||
this.setAttribute('title', text);
|
||||
} else {
|
||||
@@ -63,7 +63,7 @@
|
||||
},
|
||||
|
||||
_computeDisplayText(text, limit) {
|
||||
if (!!limit && text.length > limit) {
|
||||
if (!!limit && !!text && text.length > limit) {
|
||||
return text.substr(0, limit - 1) + '…';
|
||||
}
|
||||
return text;
|
||||
|
Reference in New Issue
Block a user