Browse Source

Fixed incorrect subscriber SQL fetch check

Kailash Nadh 6 years ago
parent
commit
0a86ae761b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      subscribers.go

+ 1 - 1
subscribers.go

@@ -57,7 +57,7 @@ func handleGetSubscriber(c echo.Context) error {
 	if err != nil {
 		return echo.NewHTTPError(http.StatusInternalServerError,
 			fmt.Sprintf("Error fetching subscriber: %s", pqErrMsg(err)))
-	} else if err == sql.ErrNoRows {
+	} else if len(out) == 0 {
 		return echo.NewHTTPError(http.StatusBadRequest, "Subscriber not found.")
 	}
 	out.LoadLists(app.Queries.GetSubscriberLists)