diff --git a/plugins/SegmentEditor/javascripts/Segmentation.js b/plugins/SegmentEditor/javascripts/Segmentation.js index 5d843e6fcf77ff2b7ab827cb230414e7d40d9559..5193eacccd769b4a9082e15bb815c7caade8464a 100644 --- a/plugins/SegmentEditor/javascripts/Segmentation.js +++ b/plugins/SegmentEditor/javascripts/Segmentation.js @@ -590,17 +590,21 @@ Segmentation = (function($) { method: 'API.getSuggestedValuesForSegment', segmentName: segmentName }, 'GET'); + ajaxHandler.useRegularCallbackInCaseOfError = true; ajaxHandler.setCallback(function(response) { loadingElement.hide(); - inputElement.autocomplete({ - source: response, - minLength: 0, - select: function(event, ui){ - event.preventDefault(); - $(inputElement).val(ui.item.value); - } - }); + if (response && response.result != 'error') { + + inputElement.autocomplete({ + source: response, + minLength: 0, + select: function(event, ui){ + event.preventDefault(); + $(inputElement).val(ui.item.value); + } + }); + } inputElement.click(function (e) { $(inputElement).autocomplete('search', $(inputElement).val());