Skip to content

Commit

Permalink
Fix index logic error that caused out of range when system has only 1…
Browse files Browse the repository at this point in the history
… mac address available.
  • Loading branch information
Dustinmj committed Oct 1, 2017
1 parent a6e04a9 commit 6afcfee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/upnp.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package server

import (
"errors"
"github.com/dustinmj/renotts/coms"
"github.com/fromkeith/gossdp"
"strings"
Expand Down Expand Up @@ -101,7 +102,8 @@ func getMacStr() (string, error) {
}
var mac string
if len(mcs) > 0 {
mac = mcs[1]
mac = mcs[0]
return strings.Replace(mac, ":", "", -1), nil
}
return strings.Replace(mac, ":", "", -1), nil
return "", errors.New("could not identify valid mac address")
}

0 comments on commit 6afcfee

Please sign in to comment.