webtorrent / webtorrent-cli

WebTorrent, the streaming torrent client. For the command line.
https://webtorrent.io
MIT License
1.16k stars 133 forks source link

TypeError: Cannot use 'in' operator to search for 'result' in undefined #200

Open Aldarone opened 2 years ago

Aldarone commented 2 years ago

What version of this package are you using?

webtorrent-cli 4.0.0, webtorrent 1.5.6

What operating system, Node.js, and npm version?

ArchLinux, node v17.0.1, npm v8.1.0

What happened?

Started a movie using webtorrent --xbmc "MAGNETLINK", the movie starts on the media player (It's a RPi running Kodi) but after one or two minutes webtorrent crashes with the following error message :

UNEXPECTED ERROR: If this is a bug in WebTorrent, report it!
OPEN AN ISSUE: https://github.com/webtorrent/webtorrent-cli/issues

DEBUG INFO: webtorrent-cli 4.0.0, webtorrent 1.5.6, node v17.0.1, linux x64, exit 1
/home/user/.nvm/versions/node/v17.0.1/lib/node_modules/webtorrent-cli/node_modules/nodebmc/device.js:41
            if( !('result' in result) && result.result !== 'ok' ) {
                           ^

TypeError: Cannot use 'in' operator to search for 'result' in undefined
    at IncomingMessage.<anonymous> (/home/user/.nvm/versions/node/v17.0.1/lib/node_modules/webtorrent-cli/node_modules/nodebmc/device.js:41:28)
    at IncomingMessage.emit (node:events:402:35)
    at endReadableNT (node:internal/streams/readable:1340:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

Node.js v17.0.1

What did you expect to happen?

Webtorrent not to crash

Are you willing to submit a pull request to fix this bug?

I don't know JS

github-actions[bot] commented 2 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

victorlpgazolli commented 2 years ago

See related: