Schoolie440 / ScreepsCoop

Brian, Joe, and Ben's Coop Screeps Repo
0 stars 1 forks source link

Error generated in repair logic #30

Closed schoolie closed 5 years ago

schoolie commented 5 years ago

I've gotten this error a few times via email:

jobs:140
      if(repairTarget.hits == repairTarget.hitsMax) {
                      ^

TypeError: Cannot read property 'hits' of null
    at Object.repairStructures (jobs:140:23)
    at Object.run (workerManager:44:14)
    at Object.module.exports.loop (main:13:19)
    at __mainLoop:1:52
    at sigintHandlersWrap (vm.js:98:15)

Looks like occasionally there aren't any structures that need repair, and that's throwing an error?

Schoolie440 commented 5 years ago

Yeah, sorry so have I. Haven't really tried to track it down yet. I am assuming I just need to move that into an existing if(target) or add a new one. I assume that runs after something gets completely repaired and target goes null or something.

On Fri, Aug 24, 2018, 11:37 AM Brian Schoolcraft notifications@github.com wrote:

I've gotten this error a few times via email:

jobs:140 if(repairTarget.hits == repairTarget.hitsMax) { ^

TypeError: Cannot read property 'hits' of null at Object.repairStructures (jobs:140:23) at Object.run (workerManager:44:14) at Object.module.exports.loop (main:13:19) at __mainLoop:1:52 at sigintHandlersWrap (vm.js:98:15)```

Looks like occasionally there aren't any structures that need repair, and that's throwing an error?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/schoolie3344/ScreepsCoop/issues/30, or mute the thread https://github.com/notifications/unsubscribe-auth/AGh19J6M-_kLE9JFigCWrD9Yzefa26rfks5uUB3CgaJpZM4WLkYl .

schoolie commented 5 years ago

No big deal, just wanted to add it to the issues list so it doesn't get lost :)

Schoolie440 commented 5 years ago

I may have just fixed it. We'll give it a few days and see if any errors come up

On Fri, Aug 24, 2018, 12:11 PM Brian Schoolcraft notifications@github.com wrote:

No big deal, just wanted to add it to the issues list so it doesn't get lost :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/schoolie3344/ScreepsCoop/issues/30#issuecomment-415806993, or mute the thread https://github.com/notifications/unsubscribe-auth/AGh19MnFgDr_SghiM2542vA7hZogP3fLks5uUCXJgaJpZM4WLkYl .

Schoolie440 commented 5 years ago

Haven't seen any new errors, so closing issue