Fix bug # 17385: calling ServiceManager::GetService() can fail for windows that aren't local due to security, so wrap the call inside of a "try" block.

This commit is contained in:
rjc%netscape.com 1999-12-03 02:22:16 +00:00
Родитель 277a68344f
Коммит bc9e4c4d31
2 изменённых файлов: 6 добавлений и 6 удалений

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

@ -460,11 +460,11 @@ function UpdateBookmarksLastVisitedDate(event)
if (window.content.location.href && window.content.location.href != "")
{
// if the URL is bookmarked, update its "Last Visited" date
var bmks = Components.classes["component://netscape/browser/bookmarks-service"].getService();
if (bmks) bmks = bmks.QueryInterface(Components.interfaces.nsIBookmarksService);
try
{
// if the URL is bookmarked, update its "Last Visited" date
var bmks = Components.classes["component://netscape/browser/bookmarks-service"].getService();
if (bmks) bmks = bmks.QueryInterface(Components.interfaces.nsIBookmarksService);
if (bmks) bmks.UpdateBookmarkLastVisitedDate(window.content.location.href);
}
catch(ex)

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

@ -460,11 +460,11 @@ function UpdateBookmarksLastVisitedDate(event)
if (window.content.location.href && window.content.location.href != "")
{
// if the URL is bookmarked, update its "Last Visited" date
var bmks = Components.classes["component://netscape/browser/bookmarks-service"].getService();
if (bmks) bmks = bmks.QueryInterface(Components.interfaces.nsIBookmarksService);
try
{
// if the URL is bookmarked, update its "Last Visited" date
var bmks = Components.classes["component://netscape/browser/bookmarks-service"].getService();
if (bmks) bmks = bmks.QueryInterface(Components.interfaces.nsIBookmarksService);
if (bmks) bmks.UpdateBookmarkLastVisitedDate(window.content.location.href);
}
catch(ex)