From aa4b77887fb2da72fde9eb8124f84f70f37bdb9f Mon Sep 17 00:00:00 2001 From: stonebuzz Date: Fri, 12 Jul 2024 15:56:52 +0200 Subject: [PATCH] Fix(Mobilesync): prevent 'undefined index' when sync security --- inc/mobilesync.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/inc/mobilesync.class.php b/inc/mobilesync.class.php index 027a076..fc90af7 100644 --- a/inc/mobilesync.class.php +++ b/inc/mobilesync.class.php @@ -390,14 +390,14 @@ protected function syncSecurity(): PluginJamfDeviceSync $this->jamfplugin_item_changes['lost_location_date'] = $lost_location_date; } $this->commondevice_changes['activation_lock_enabled'] = $security['activation_lock_enabled']; - $this->jamfplugin_item_changes['lost_mode_enabled'] = $security['lost_mode_enabled']; - $this->jamfplugin_item_changes['lost_mode_enforced'] = $security['lost_mode_enforced']; - $this->jamfplugin_item_changes['lost_mode_message'] = $security['lost_mode_message']; - $this->jamfplugin_item_changes['lost_mode_phone'] = $security['lost_mode_phone']; - $this->jamfplugin_item_changes['lost_location_latitude'] = $security['lost_location_latitude']; - $this->jamfplugin_item_changes['lost_location_longitude'] = $security['lost_location_longitude']; - $this->jamfplugin_item_changes['lost_location_altitude'] = $security['lost_location_altitude']; - $this->jamfplugin_item_changes['lost_location_speed'] = $security['lost_location_speed']; + $this->jamfplugin_item_changes['lost_mode_enabled'] = $security['lost_mode_enabled'] ?? ''; + $this->jamfplugin_item_changes['lost_mode_enforced'] = $security['lost_mode_enforced'] ?? 0; + $this->jamfplugin_item_changes['lost_mode_message'] = $security['lost_mode_message'] ?? ''; + $this->jamfplugin_item_changes['lost_mode_phone'] = $security['lost_mode_phone'] ?? ''; + $this->jamfplugin_item_changes['lost_location_latitude'] = $security['lost_location_latitude'] ?? ''; + $this->jamfplugin_item_changes['lost_location_longitude'] = $security['lost_location_longitude'] ?? ''; + $this->jamfplugin_item_changes['lost_location_altitude'] = $security['lost_location_altitude'] ?? ''; + $this->jamfplugin_item_changes['lost_location_speed'] = $security['lost_location_speed'] ?? ''; } catch (Exception $e) { $this->status['syncSecurity'] = self::STATUS_ERROR; return $this;