fix issues when MDM info is empty during migration (#13320)

for #13319
This commit is contained in:
Roberto Dip
2023-08-14 19:21:06 -03:00
committed by GitHub
parent 34bacf5312
commit 998e1dfb6b
7 changed files with 11 additions and 113 deletions
+1 -1
View File
@@ -549,7 +549,7 @@ func (h *Host) IsEligibleForDEPMigration() bool {
// NeedsDEPEnrollment returns true if the host should be DEP enrolled into
// fleet but it's currently unenrolled.
func (h *Host) NeedsDEPEnrollment() bool {
return !h.MDMInfo.IsDEPFleetEnrolled() &&
return h.MDMInfo != nil && !h.MDMInfo.IsDEPFleetEnrolled() &&
!h.MDMInfo.IsManualFleetEnrolled() &&
!h.MDMInfo.IsEnrolledInThirdPartyMDM() &&
h.IsDEPAssignedToFleet()