File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
src/IntuneCD/update/Intune Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -172,12 +172,21 @@ def main(self) -> dict[str, any]:
172172 for rule in repo_data .get ("scheduledActionsForRule" ):
173173 self ._get_notification_template_id (rule )
174174
175- for item in intune_data ["value" ]:
176- if item ["scheduledActionsForRule" ]:
177- for action in item ["scheduledActionsForRule" ][0 ][
178- "scheduledActionConfigurations"
179- ]:
180- self .remove_keys (action )
175+ for item in intune_data .get (
176+ "value" , []
177+ ): # Ensure "value" exists and is iterable
178+ actions = item .get ("scheduledActionsForRule" , [])
179+
180+ if actions : # Ensure actions is not None and not empty
181+ first_action = actions [0 ].get (
182+ "scheduledActionConfigurations" , []
183+ )
184+
185+ if (
186+ first_action
187+ ): # Ensure scheduledActionConfigurations is not None
188+ for action in first_action :
189+ self .remove_keys (action )
181190
182191 try :
183192 self .process_update (
You can’t perform that action at this time.
0 commit comments