From 8be9bf00a75dce8747939eb34b49dc75757b5ea1 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Wed, 9 Jun 2021 16:04:16 +0200 Subject: [PATCH] Fixes creation of default threshold values --- doc/31-Changelog.md | 1 + lib/core/tools/ConvertTo-Seconds.psm1 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/31-Changelog.md b/doc/31-Changelog.md index f76a808..729c8bd 100644 --- a/doc/31-Changelog.md +++ b/doc/31-Changelog.md @@ -19,6 +19,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic * [#276](https://github.com/Icinga/icinga-powershell-framework/pull/276) Fixes check value conversion to decimal, which sometimes did not resolve values properly and caused conversion issues * [#282](https://github.com/Icinga/icinga-powershell-framework/issues/282) Fixes issue on `System.Text.StringBuilder` which fails to initialize properly on some older Windows systems +* [#284](https://github.com/Icinga/icinga-powershell-framework/issues/284) Fixes exception while creating default threshold objects * [#285](https://github.com/Icinga/icinga-powershell-framework/issues/285) Fixes plain Icinga 2 conf generation for commands, which was caused by a new exception output for additional output ## 1.5.0 (2021-06-02) diff --git a/lib/core/tools/ConvertTo-Seconds.psm1 b/lib/core/tools/ConvertTo-Seconds.psm1 index 0114015..195f951 100644 --- a/lib/core/tools/ConvertTo-Seconds.psm1 +++ b/lib/core/tools/ConvertTo-Seconds.psm1 @@ -52,7 +52,7 @@ function ConvertTo-Seconds() } } - if (-Not $hasUnit) { + if (-Not $hasUnit -Or (Test-Numeric $NumberPart) -eq $FALSE) { return $Value; }