Return an empty set if getting recipes for host fails.

This avoids errors when _recipeManager is not (yet) available.
This resolves #496.
This commit is contained in:
wolfbeast 2018-12-21 14:14:15 +01:00 committed by Roy Tam
commit 0298125fa6

View file

@ -102,8 +102,13 @@ var LoginManagerParent = {
}
case "RemoteLogins:findRecipes": {
let formHost = (new URL(data.formOrigin)).host;
return this._recipeManager.getRecipesForHost(formHost);
try {
let formHost = (new URL(data.formOrigin)).host;
return this._recipeManager.getRecipesForHost(formHost);
} catch(e) {
// Just return an empty set in case of error.
return new Set();
}
}
case "RemoteLogins:onFormSubmit": {