Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restores silent failure behavior when a fileType has no iconClass #7027

Merged
merged 1 commit into from Aug 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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