Bug 1029486 - Check for dead wrappers after running language detection r=felipe

This commit is contained in:
Tim Taubert 2014-06-24 14:04:45 +02:00
parent 3b01f496de
commit 4dcf437636

View File

@ -85,8 +85,15 @@ TranslationContentHandler.prototype = {
return;
LanguageDetector.detectLanguage(string).then(result => {
if (!result.confident)
// Bail if we're not confident.
if (!result.confident) {
return;
}
// The window might be gone by now.
if (Cu.isDeadWrapper(content)) {
return;
}
content.detectedLanguage = result.language;