Fix nil user condition in account id retrieval
@@ -2,6 +2,7 @@ package db
import (
"context"
+ "errors"
"net/http"
"github.com/lbryio/lbrytv/config"
@@ -78,6 +79,9 @@ func GetAccountIDFromRequest(req *http.Request) (string, error) {
if err != nil {
return "", err
}
+ if u == nil {
+ return "", errors.New("unable to retrieve user")
+ }
return u.SDKAccountID, nil
}
return "", nil
