-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix concurrent player check #420
Conversation
Actually, even with this, I still got:
|
oof, https://github.com/online-go/goban/blob/7966731fea970341987103a9e02e38c2bd31255c/src/GoEngine.ts#L120 marks Line 26 in 9478fd1
|
src/main.ts
Outdated
if (state === undefined) { | ||
return false; | ||
} | ||
if (state.player_pool !== undefined) { | ||
return !!state.player_pool[player_id]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May 12 16:44:07 ! source-map-support.js:499 TypeError: Cannot read properties of null (reading 'player_pool')
at /home/siim/projects/gtp2ogs-release/dist/webpack:/gtp2ogs/src/main.ts:717:27
means that state
was null, not undefined
if (state === undefined) { | |
return false; | |
} | |
if (state.player_pool !== undefined) { | |
return !!state.player_pool[player_id]; | |
if (state?.player_pool !== undefined) { | |
return !!state.player_pool[player_id]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah! I had added a trace.log
for when state
was undefined
but I guess it looks like that might be the case in pretty normal circumstances. I'll try to run your suggested form for a moment.
I'm really not much of a javascript/typescript dev. Is there a neater way to express the count, or is what I've done OK? |
The `player_pool` property does not exist on main site (yet?).
I've been running with this change for a few days now, no more crashes so far. |
The
player_pool
property does not exist on main site (yet?).