diff --git a/doc/82-Changelog.md b/doc/82-Changelog.md index 9ad75bd4..7456053f 100644 --- a/doc/82-Changelog.md +++ b/doc/82-Changelog.md @@ -13,6 +13,7 @@ next (will be 1.9.0) ### Import and Sync * FIX: string property modifiers now preserve NULL values (#2371) +* FIX: "to int" property modifiers now fails for non-string values (#2372) * FEATURE: introduce 'disable' as your purge action on Sync (#2285) * FEATURE: there is now a simple "group by" Property Modifier (#2317) diff --git a/library/Director/PropertyModifier/PropertyModifierToInt.php b/library/Director/PropertyModifier/PropertyModifierToInt.php index cfd3c23e..dca7db98 100644 --- a/library/Director/PropertyModifier/PropertyModifierToInt.php +++ b/library/Director/PropertyModifier/PropertyModifierToInt.php @@ -2,6 +2,7 @@ namespace Icinga\Module\Director\PropertyModifier; +use Icinga\Module\Director\Data\InvalidDataException; use Icinga\Module\Director\Hook\PropertyModifierHook; class PropertyModifierToInt extends PropertyModifierHook @@ -24,5 +25,7 @@ class PropertyModifierToInt extends PropertyModifierHook if (is_string($value)) { return (int) $value; } + + throw new InvalidDataException('String, integer or null', $value); } }