Skip to content

Commit

Permalink
Fix slice out of index error
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMwita committed Feb 21, 2024
1 parent 8225522 commit c89aa84
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/sms/sms_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ func (s *SmsSender) SendSMS() (SmsSenderResponse, error) {

smsMessageData := data["SMSMessageData"].(map[string]interface{})
message := smsMessageData["Message"].(string)
cost := strings.Split(message, " ")[len(message)-1]

cost := ""
for _, word := range strings.Split(message, " ") {
cost = word
}
recipientsData := smsMessageData["Recipients"].([]interface{})

for _, recipient := range recipientsData {
Expand Down

0 comments on commit c89aa84

Please sign in to comment.