@@ -308,6 +308,13 @@ private function saveRemediations(array $decisions): array
308
308
309
309
if ('Ip ' === $ decision ['scope ' ]) {
310
310
$ address = Factory::addressFromString ($ decision ['value ' ]);
311
+ if (null === $ address ) {
312
+ $ this ->logger ->warning ('' , [
313
+ 'type ' => 'INVALID_IP_TO_ADD_FROM_REMEDIATION ' ,
314
+ 'decision ' => $ decision ,
315
+ ]);
316
+ continue ;
317
+ }
311
318
$ this ->addRemediationToCacheItem ($ address ->toString (), $ type , $ exp , $ id );
312
319
} elseif ('Range ' === $ decision ['scope ' ]) {
313
320
$ range = Subnet::fromString ($ decision ['value ' ]);
@@ -347,6 +354,13 @@ private function removeRemediations(array $decisions): array
347
354
foreach ($ decisions as $ decision ) {
348
355
if ('Ip ' === $ decision ['scope ' ]) {
349
356
$ address = Factory::addressFromString ($ decision ['value ' ]);
357
+ if (null === $ address ) {
358
+ $ this ->logger ->warning ('' , [
359
+ 'type ' => 'INVALID_IP_TO_REMOVE_FROM_REMEDIATION ' ,
360
+ 'decision ' => $ decision ,
361
+ ]);
362
+ continue ;
363
+ }
350
364
if (!$ this ->removeDecisionFromRemediationItem ($ address ->toString (), $ decision ['id ' ])) {
351
365
$ this ->logger ->debug ('' , ['type ' => 'DECISION_TO_REMOVE_NOT_FOUND_IN_CACHE ' , 'decision ' => $ decision ['id ' ]]);
352
366
} else {
0 commit comments