mineflayer: Missing null check in digging.js

I get this unhandled error at random:

C:\Users\Jakub\node_modules\mineflayer\lib\plugins\digging.js:76
          location: bot.targetDigBlock.position,
                                      ^
TypeError: Cannot read property 'position' of null
    at finishDigging [as _onTimeout] (C:\Users\Jakub\node_modules\mineflayer\lib\plugins\digging.js:76:39)
    at Timer.listOnTimeout (timers.js:110:15)

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 18 (15 by maintainers)

Commits related to this issue

Most upvoted comments

It also seems to happen after it dies.

I am having the same issue, it says cannot read property position of null (digging.js). I am using the pathfinder plugin but it digs and then crashes.

/run/media/theoparis/TheoData/Essentials/Projects/Programming/untitled/node_modules/.pnpm/mineflayer@2.37.1/node_modules/mineflayer/lib/plugins/digging.js:41
        location: bot.targetDigBlock.position,
                                     ^

TypeError: Cannot read property 'position' of null