Bug 324111 - Extension Manager window is empty (e.g. datasource not loaded) when the extensions.rdf is corrupt. r=bsmedberg

This commit is contained in:
rob_strong%exchangecode.com 2006-02-15 21:52:09 +00:00
Родитель 1a5272733a
Коммит 1f4b648438
1 изменённых файлов: 9 добавлений и 1 удалений

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

@ -6492,7 +6492,15 @@ ExtensionsDataSource.prototype = {
*/
loadExtensions: function() {
var extensionsFile = getFile(KEY_PROFILEDIR, [FILE_EXTENSIONS]);
this._inner = gRDF.GetDataSourceBlocking(getURLSpecFromFile(extensionsFile));
try {
this._inner = gRDF.GetDataSourceBlocking(getURLSpecFromFile(extensionsFile));
}
catch (e) {
LOG("Datasource::loadExtensions: removing corrupted extensions datasource " +
" file = " + extensionsFile.path + ", exception = " + e + "\n");
extensionsFile.remove(false);
return;
}
var cu = Components.classes["@mozilla.org/rdf/container-utils;1"]
.getService(Components.interfaces.nsIRDFContainerUtils);