Handle null case for mdm data in host details UI

This commit is contained in:
gillespi314 2021-12-29 17:19:26 -06:00 committed by GitHub
parent fec450ab5a
commit 0c6defc1b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -83,7 +83,7 @@ export interface IMDMData {
export interface IMacadminsResponse {
macadmins: null | {
munki: null | IMunkiData;
mobile_device_management: IMDMData;
mobile_device_management: null | IMDMData;
};
}

View file

@ -1148,10 +1148,10 @@ const HostDetailsPage = ({
};
const renderMdmData = () => {
if (!macadmins) {
if (!macadmins?.mobile_device_management) {
return null;
}
const { mobile_device_management: mdm } = macadmins;
const mdm = macadmins.mobile_device_management;
return mdm.enrollment_status !== "Unenrolled" ? (
<>
<div className="info-grid__block">