Anton %!s(int64=5) %!d(string=hai) anos
pai
achega
b0bc24f7c3
Modificáronse 2 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      api/studyPlanImport.go
  2. BIN=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)
 }
 

BIN=BIN
main