From b5aa02137ec6ed2979e6cb8dcf74a93f9356e190 Mon Sep 17 00:00:00 2001 From: Joseph Dykstra Date: Wed, 26 Nov 2014 22:38:41 -0600 Subject: [PATCH] Fixed thrown error I was getting `Uncaught TypeError: Cannot read property 'name' of undefined` with `client.seed(files)` in the browser. In `createTorrent`, opts.name is read from without checking if opts exists. (Maybe this fix should go in the `create-torrent` module?) --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index f6fcb415..bb3d5ab9 100644 --- a/index.js +++ b/index.js @@ -194,6 +194,7 @@ WebTorrent.prototype.seed = function (input, opts, onseed) { onseed = opts opts = {} } + opts = opts || {} // TODO: support `input` as string, or array of strings