[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.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user