Settings editor - fix NPE rendering settings with no description

This commit is contained in:
Rob Lourens 2018-08-01 11:55:30 -07:00
parent adf837e769
commit c259ee91ec

View file

@ -1025,7 +1025,7 @@ export class SettingsRenderer implements ITreeRenderer {
const result = this.renderValue(element, isSelected, templateId, <ISettingItemTemplate>template);
const firstLineOverflows = renderedDescription.firstElementChild.clientHeight > 18;
const firstLineOverflows = renderedDescription.firstElementChild && renderedDescription.firstElementChild.clientHeight > 18;
const hasExtraLines = renderedDescription.childElementCount > 1;
const needsManualOverflowIndicator = (hasExtraLines || result.overflows) && !firstLineOverflows && !isSelected;
DOM.toggleClass(template.descriptionElement, 'setting-item-description-artificial-overflow', needsManualOverflowIndicator);