Update Route Controller to ensure that response is valid before parsin
This commit is contained in:
parent
b6e5f09c11
commit
c3a414285a
@ -170,10 +170,16 @@ namespace EFB.Controllers
|
|||||||
{
|
{
|
||||||
//Get Response from Charts
|
//Get Response from Charts
|
||||||
ResponseModel<ChartResponse> responseDepartureCharts = await requestDepartureCharts;
|
ResponseModel<ChartResponse> responseDepartureCharts = await requestDepartureCharts;
|
||||||
user.DepartureCharts = new ChartModel(responseDepartureCharts.Result.Response);
|
if (responseDepartureCharts.Error == null && responseDepartureCharts.Result.Status == "success")
|
||||||
|
{
|
||||||
|
user.DepartureCharts = new ChartModel(responseDepartureCharts.Result.Response);
|
||||||
|
}
|
||||||
|
|
||||||
ResponseModel<ChartResponse> responseArrivalCharts = await requestArrivalCharts;
|
ResponseModel<ChartResponse> responseArrivalCharts = await requestArrivalCharts;
|
||||||
user.ArrivalCharts = new ChartModel(responseArrivalCharts.Result.Response);
|
if (responseArrivalCharts.Error == null && responseArrivalCharts.Result.Status == "success")
|
||||||
|
{
|
||||||
|
user.ArrivalCharts = new ChartModel(responseArrivalCharts.Result.Response);
|
||||||
|
}
|
||||||
|
|
||||||
//fill in route
|
//fill in route
|
||||||
string finalRoute = RouteModel.ParseRoute(routeString);
|
string finalRoute = RouteModel.ParseRoute(routeString);
|
||||||
|
Loading…
Reference in New Issue
Block a user