question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing null check in digging.js

See original GitHub issue

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)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:18 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
theopariscommented, Dec 15, 2020

It also seems to happen after it dies.

1reaction
theopariscommented, Dec 15, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ruby check if nil before calling method - null - Stack Overflow
Ruby 2.3.0 added a safe navigation operator ( &. ) that checks for nil before calling a method. s&.strip. If s is nil...
Read more >
JavaScript Nullable – How to Check for Null in JS
So, null is nothing and undefined is just missing. ... You can check for null with the typeof() operator in JavaScript.
Read more >
3 Clever Ways to Return Empty Value Instead of Null From a ...
It is best practice to return empty values rather than null ones. Especially when you return a collection, enumerable, or an object, you...
Read more >
How to have a time chart show zero for missing/null data.
Hi, I have a data set that when I use the summarize/bin over a 1 min interval has gaps in the data (hours)...
Read more >
For loop returning value of null from an array. How do I fix this?
Let's dig into the code. I'm storing the radio buttons in an array. And scrolling through to find the checked button. //Find all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found