Skip to content

Commit

Permalink
ticket #28 - add a check to see if the callback is null or undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
uaihebert committed Nov 25, 2018
1 parent a7260e5 commit 40329e6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/resources/javascript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ app.controller('routeController', function($scope, $http, growl, $location) {

let callback = route.callback;

if (callback !== null) {
if (callback !== undefined && callback !== null) {
if (!Number.isInteger(callback.delayInMilli)) {
error.hasError = true;
error.errorHtml += "<li>callback.delayInMilli should be a valid int</li>";
Expand Down Expand Up @@ -236,8 +236,12 @@ app.controller('routeController', function($scope, $http, growl, $location) {

$scope.selectedRouteRow.route.response.headerList = $scope.convertStringToList($scope.selectedRouteRow.route.response.headerList);

$scope.selectedRouteRow.route.callback.headerList = $scope.convertStringToList($scope.selectedRouteRow.route.callback.headerList);
$scope.selectedRouteRow.route.callback.queryParamList = $scope.convertStringToList($scope.selectedRouteRow.route.callback.queryParamList);
let callback = $scope.selectedRouteRow.route.callback;

if (callback !== undefined && callback !== null) {
callback.headerList = $scope.convertStringToList(callback.headerList);
callback.queryParamList = $scope.convertStringToList(callback.queryParamList);
}

const errorText = $scope.getErrorText($scope.selectedRouteRow.route);

Expand Down

0 comments on commit 40329e6

Please sign in to comment.