Skip to content

Commit

Permalink
SlackStatus: Prevent error output when expiry is empty
Browse files Browse the repository at this point in the history
This can cause issues if the user wants to parse the server reponse
  • Loading branch information
mirka committed Feb 22, 2021
1 parent 92c0705 commit 403c6a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/set-slack-status/default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [[ ! -z "$KMPARAM_Status_text" || $both_empty -eq 0 ]]; then
fi

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

0 comments on commit 403c6a8

Please sign in to comment.