mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Check object instanceof on all detail panels (#4054)
* Check object instanceof on all detail panels Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix unit tests - Remove prettier as snapShot testing is too tight of a bound Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
dabfce3609
commit
052d12fc19
32 files changed
+392
-168
No files matched your search
@@ -25,9 +25,10 @@ import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { DrawerTitle } from "../drawer";
|
||||
import type { KubeObjectDetailsProps } from "../kube-object-details";
|
||||
import type { Endpoint } from "../../../common/k8s-api/endpoints";
|
||||
import { Endpoint } from "../../../common/k8s-api/endpoints";
|
||||
import { KubeObjectMeta } from "../kube-object-meta";
|
||||
import { EndpointSubsetList } from "./endpoint-subset-list";
|
||||
import logger from "../../../common/logger";
|
||||
|
||||
interface Props extends KubeObjectDetailsProps<Endpoint> {
|
||||
}
|
||||
@@ -37,7 +38,15 @@ export class EndpointDetails extends React.Component<Props> {
|
||||
render() {
|
||||
const { object: endpoint } = this.props;
|
||||
|
||||
if (!endpoint) return null;
|
||||
if (!endpoint) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!(endpoint instanceof Endpoint)) {
|
||||
logger.error("[EndpointDetails]: passed object that is not an instanceof Endpoint", endpoint);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="EndpointDetails">
|
||||
|
||||
Reference in new issue
Block a user