]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/peertube-chunk-store.ts
Fix playback rate hotkey
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / peertube-chunk-store.ts
index e14e31c0466c23285eb4f68d64a2b08b5d7e3e5a..767e468219b1bf9221200af8984a62cce6c31168 100644 (file)
@@ -118,7 +118,13 @@ export class PeertubeChunkStore extends EventEmitter {
 
     // IndexDB could be slow, use our memory index first
     const memoryChunk = this.memoryChunks[index]
-    if (memoryChunk === undefined) return cb(null, new Buffer(0))
+    if (memoryChunk === undefined) {
+      const err = new Error('Chunk not found')
+      err['notFound'] = true
+
+      return process.nextTick(() => cb(err))
+    }
+
     // Chunk in memory
     if (memoryChunk !== true) return cb(null, memoryChunk)