Skip to content

Commit 403c6a8

Browse files
committed
SlackStatus: Prevent error output when expiry is empty
This can cause issues if the user wants to parse the server reponse
1 parent 92c0705 commit 403c6a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/set-slack-status/default.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if [[ ! -z "$KMPARAM_Status_text" || $both_empty -eq 0 ]]; then
1919
fi
2020

2121
# Calculate expiration unixtime (if set to more than 0)
22-
if [[ $(bc -l <<< "$KMPARAM_Clear_after_x_hours > 0") -eq 1 ]]; then
22+
if [[ ! -z "$KMPARAM_Clear_after_x_hours" && $(bc -l <<< "$KMPARAM_Clear_after_x_hours > 0") -eq 1 ]]; then
2323
unix_now=$(date +%s)
2424
offset=$(bc -l <<< "$KMPARAM_Clear_after_x_hours * 3600")
2525
integer_offset=$(printf "%.0f" $offset)

0 commit comments

Comments
 (0)