Bug 1157201 - Prevent exception while hovering the rule-view. r=pbrosset

This commit is contained in:
Alexandre Poirot 2015-04-22 07:34:00 +02:00
Родитель b560b0ca8d
Коммит 11b2ddad6e
2 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -368,6 +368,8 @@ Tooltip.prototype = {
* A function that accepts a node argument and returns true or false
* (or a promise that resolves or rejects) to signify if the tooltip
* should be shown on that node or not.
* If the promise rejects, it must reject `false` as value.
* Any other value is going to be logged as unexpected error.
* Additionally, the function receives a second argument which is the
* tooltip instance itself, to be used to add/modify the content of the
* tooltip if needed. If omitted, the tooltip will be shown everytime.

Просмотреть файл

@ -341,13 +341,13 @@ TooltipsOverlay.prototype = {
let nodeInfo = this.view.getNodeInfo(target);
if (!nodeInfo) {
// The hovered node isn't something we care about
return promise.reject();
return promise.reject(false);
}
let type = this._getTooltipType(nodeInfo);
if (!type) {
// There is no tooltip type defined for the hovered node
return promise.reject();
return promise.reject(false);
}
if (this.isRuleView && this.colorPicker.tooltip.isShown()) {