title: Why does indexedDB objectStore.get call onsuccess even when the objectStore does not contain the object?
body: <p>One of the odd things about indexedDB is that a objectStore.get() request with a key that is not in the objectstore generates a success event with <code>(event.target.results ==  undefined)</code> (see: <a href="http://www.w3.org/TR/IndexedDB/#object-store" rel="nofollow">http://www.w3.org/TR/IndexedDB/#object-store</a> the get function).</p>
  
  <p>I need to trap this type of <em>"success"</em> and log it. Right now, I cannot find the KEY in the returned event. So I am doing a real hack and storing it in the transaction. Any advice?</p>
  
  <pre><code>   var deferred = new jQuery.Deferred(); // this is what gets returned
      var id = view.zoom + "-" + view.tile.column + "-" + view.tile.row;
      trans = DB.transaction(["Images"], "readonly");
      store = trans.objectStore("Images");
      req = store.get(id);
      trans._keyPathForGet = id; // hack
      req.onsuccess = function (e) {
          var blob = e.target.result;
          if (blob == undefined) {
              console.log("no blob of id: " + e.target.transaction._keyPathForGet);
              deferred.resolve(null);
          } else {
              var imgURL = URL.createObjectURL(blob);
              deferred.resolve(imgURL); // let leaflet know we're done, and give it the URL
              URL.revokeObjectURL(imgURL); // not sure if we're revoking it too soon here
          }
  </code></pre>