fix: do not crash on unknown chart + footer (#1268)

* fix: do not krash on unknown chart + footer

* chore: use undefined instead
This commit is contained in:
Tobias Åström
2023-05-15 09:42:06 +02:00
committed by GitHub
parent 0530574be8
commit 05abdf4f55
3 changed files with 4 additions and 4 deletions

View File

@@ -569,7 +569,7 @@ const Cell = forwardRef(
>
{Content}
</Grid>
<Footer layout={layout} titleStyles={titleStyles} />
{cellNode && layout && state.sn && <Footer layout={layout} titleStyles={titleStyles} />}
</Grid>
{state.longRunningQuery && <LongRunningQuery canCancel={canCancel} canRetry={canRetry} api={longrunning} />}
</Paper>

View File

@@ -101,9 +101,9 @@ describe('types', () => {
expect(v).toEqual('1.5.1');
});
test('should return null when no fit is found', () => {
test('should return undefined when no fit is found', () => {
const v = c.getSupportedVersion('pie', '1.2.0');
expect(v).toBe(null);
expect(v).toBe(undefined);
});
test('should return the requested type and version', () => {

View File

@@ -66,7 +66,7 @@ export function create({ halo, parent }) {
},
getSupportedVersion: (name, propertyVersion) => {
if (!tc[name]) {
return null;
return undefined;
}
return tc[name].getMatchingVersionFromProperties(propertyVersion);
},