From 748de602ef3ff3910582d20160469019c68f092d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 8 Oct 2014 10:16:36 +0200 Subject: [PATCH] [FIX] catch possible exception in search.js The search view tries to evaluate the category of a filter in order to put it in the filters or in the group by sub menu. The pyeval.eval function could throw an exception, which is not cool if it crashes the client. This fix make sure that the exception is caught. --- addons/web/static/src/js/search.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 93de734df26..69bd4c1880e 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -662,10 +662,12 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea function eval_item (item) { var category = 'filters'; if (item.attrs.context) { - var context = instance.web.pyeval.eval('context', item.attrs.context); - if (context.group_by) { - category = 'group_by'; - } + try { + var context = instance.web.pyeval.eval('context', item.attrs.context); + if (context.group_by) { + category = 'group_by'; + } + } catch (e) {} } return { item: item,