Browse Source

Additional error check

jamesread 5 years ago
parent
commit
ef5e71fa94
1 changed files with 6 additions and 1 deletions
  1. 6 1
      internal/updatecheck/updateCheck.go

+ 6 - 1
internal/updatecheck/updateCheck.go

@@ -60,7 +60,12 @@ func StartUpdateChecker(currentVersion string, currentCommit string, cfg *config
 func actualCheckForUpdate(payload updateRequest) {
 	jsonUpdateRequest, err := json.Marshal(payload)
 
-	req, err := http.NewRequest("POST", "http://update-check.olivetin.app", bytes.NewReader(jsonUpdateRequest))
+	if err != nil {
+		log.Errorf("Update check failed %v", err)
+		return
+	}
+
+	req, err := http.NewRequest("POST", "http://update-check.olivetin.app", bytes.NewBuffer(jsonUpdateRequest))
 
 	if err != nil {
 		log.Errorf("Update check failed %v", err)