changeset 78:7a0d3fec5102

recover from and report not being able to update the session history URI
author Myk Melez <myk@mozilla.org>
date Thu, 15 May 2008 11:10:48 -0700
parents d128eee04c8a
children d2a718e4a21d
files extension/content/river.js
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/extension/content/river.js	Thu May 15 11:10:19 2008 -0700
+++ b/extension/content/river.js	Thu May 15 11:10:48 2008 -0700
@@ -236,7 +236,13 @@
     // This gets used when the user reloads the page or traverses history.
     let history = gBrowserWindow.gBrowser.sessionHistory;
     let historyEntry = history.getEntryAtIndex(history.index, false);
-    historyEntry.setURI(uri);
+    if (historyEntry instanceof Ci.nsISHEntry)
+      historyEntry.setURI(uri);
+    else
+      this._log.error("can't update session history URI for " +
+                      "'" + historyEntry.title + "' " +
+                      "<" + historyEntry.URI.spec + ">; " +
+                      "entry is not an instance of nsISHEntry");
   },
 
   onScroll: function(aEvent) {