Fixing NPE in routing

before-bootstrap
Candid Dauth 2014-04-14 06:24:15 +02:00
rodzic ed2395658c
commit 89b0aaee4a
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -23,9 +23,11 @@ function calculateRouting(points, mode, callback) {
return callback(err);
if(!body || !body.route)
return callback("Invalid response from server.");
return callback("Invalid response from routing server.");
if(body.route.routeError.message)
return callback(body.route.routeError.message);
if(!body.route.shape || !body.route.shape.shapePoints)
return callback("Invalid response from routing server.");
var ret = {
actualPoints : [ ],