Skip to content

Commit

Permalink
Merge pull request #7027 from telamonian/fix-ft-iconclass-missing
Browse files Browse the repository at this point in the history
restores silent failure behavior when a fileType has no iconClass
  • Loading branch information
blink1073 committed Aug 16, 2019
2 parents bef72f1 + 5b61a77 commit 8190b83
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/ui-components/src/icon/iconregistry.tsx
Expand Up @@ -125,12 +125,16 @@ export class IconRegistry implements IIconRegistry {

resolveName(name: string): string {
if (!(name in this._svg)) {
// assume name is really a className, split the className into parts and check each part
for (let className of name.split(/\s+/)) {
if (className in this._classNameToName) {
return this._classNameToName[className];
// skip resolution if name is not defined
if (name) {
// assume name is really a className, split the className into parts and check each part
for (let className of name.split(/\s+/)) {
if (className in this._classNameToName) {
return this._classNameToName[className];
}
}
}

if (this._debug) {
// couldn't resolve name, mark as bad and warn
console.error(`Invalid icon name: ${name}`);
Expand Down

0 comments on commit 8190b83

Please sign in to comment.