From 7d26741ce41760cccd201fc6a03ea09e1f6a4cba Mon Sep 17 00:00:00 2001 From: Valentin Date: Wed, 8 Jan 2020 11:28:05 -0500 Subject: [PATCH] Added check to make sure the Gradient STRING has a length --- Modules/Color/Color.psm1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Modules/Color/Color.psm1 b/Modules/Color/Color.psm1 index b02b82b..625c42c 100644 --- a/Modules/Color/Color.psm1 +++ b/Modules/Color/Color.psm1 @@ -112,6 +112,10 @@ class Style { return $result } [String]WriteGradient([UInt32]$foreStart, [UInt32]$foreEnd, [UInt32]$backStart, [UInt32]$backEnd, [string]$val) { + if ($val.Length -eq 0 ) + { + return ""; + } $foreRStart = ($foreStart -shr 16 -band 255) $foreREnd = ($foreEnd -shr 16 -band 255) $foreRDiff = ($foreREnd - $foreRStart) / $val.Length