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:
evazion
2019-10-30 23:43:52 -05:00
parent bf841dcd44
commit 9cfb753c1b

View File

@@ -89,7 +89,7 @@ PostTooltip.initialize = function () {
$(document).on("mouseleave.danbooru.postTooltip", PostTooltip.POST_SELECTOR, function (event) {
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();
}
});