diff --git a/dom/indexedDB/IDBCursor.cpp b/dom/indexedDB/IDBCursor.cpp index 79e09af93c8a..370f6e2a27ba 100644 --- a/dom/indexedDB/IDBCursor.cpp +++ b/dom/indexedDB/IDBCursor.cpp @@ -505,8 +505,6 @@ void IDBCursor::ContinuePrimaryKey(JSContext* aCx, JS::Handle aKey, key = tmp; } - const Key& sortKey = IsLocaleAware() ? mSortKey : mKey; - if (key.IsUnset()) { aRv.Throw(NS_ERROR_DOM_INDEXEDDB_DATA_ERR); return; @@ -526,6 +524,8 @@ void IDBCursor::ContinuePrimaryKey(JSContext* aCx, JS::Handle aKey, return; } + const Key& sortKey = IsLocaleAware() ? mSortKey : mKey; + switch (mDirection) { case NEXT: if (key < sortKey || (key == sortKey && primaryKey <= mPrimaryKey)) {