post tooltips: fix null deref when tooltips are disabled.
Fix an exception that is triggered by mousing out of a thumbnail when tooltips are disabled. Caused by trying to access `qtip.cache` when `qtip` is null.
This commit is contained in:
@@ -89,7 +89,7 @@ PostTooltip.initialize = function () {
|
|||||||
$(document).on("mouseleave.danbooru.postTooltip", PostTooltip.POST_SELECTOR, function (event) {
|
$(document).on("mouseleave.danbooru.postTooltip", PostTooltip.POST_SELECTOR, function (event) {
|
||||||
let qtip = $(event.target).qtip("api");
|
let qtip = $(event.target).qtip("api");
|
||||||
|
|
||||||
if (qtip.cache.request && qtip.cache.request.state() === "pending") {
|
if (qtip && qtip.cache && qtip.cache.request && qtip.cache.request.state() === "pending") {
|
||||||
qtip.cache.request.abort();
|
qtip.cache.request.abort();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user