mirror of
https://github.com/desktop/desktop
synced 2024-09-14 05:41:46 +00:00
Add a type guard for the missing case
This commit is contained in:
parent
7a1cfb778a
commit
9d4b73408e
|
@ -54,6 +54,12 @@ export class Octicon extends React.Component<IOcticonProps, {}> {
|
|||
)
|
||||
|
||||
const scaledSymbol = symbol[naturalHeight]
|
||||
|
||||
if (scaledSymbol === undefined) {
|
||||
// Should never happen, but if it does the app should still be usable
|
||||
return null
|
||||
}
|
||||
|
||||
const naturalWidth = scaledSymbol.w
|
||||
const width = height * (naturalWidth / naturalHeight)
|
||||
|
||||
|
|
Loading…
Reference in a new issue