Anton 5 yıl önce
ebeveyn
işleme
b0bc24f7c3
2 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  1. 3 0
      api/studyPlanImport.go
  2. BIN
      main

+ 3 - 0
api/studyPlanImport.go

@@ -17,6 +17,9 @@ func ImportPlanRoute(w http.ResponseWriter, r *http.Request){
 	}
 	tempname := readFile(input)
 	result := xlsx.ImportXLSX(tempname)
+	if result == nil{
+		json.NewEncoder(w).Encode(struct{Error string}{Error: "Error while processing file"})
+	}
 	json.NewEncoder(w).Encode(result)
 }