Issue Fix: nullreferenceexception 이슈 #41
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
경로: src/chat.ts
이슈: 특정 스트리머의 경우 chatChannelId 값이 없는경우가 간헐적으로 있음.
const serverId = Math.abs( this.options.chatChannelId.split("") .map(c => c.charCodeAt(0)) .reduce((a, b) => a + b) ) % 9 + 1
107번 라인의 위 코드에서 참조에러 (this.options.chatChannelId 이 null 인데 split을 사용함)
조치:
if(!this.options.chatChannelId){ return this.emit('NoChatChannelId', await this.client.live.status(this.options.channelId)); }
this.options.chatChannelId 값이 없을때, return 하였습니다.
this.emit을 통해 소켓으로 해당 스트리머의 status 값도 넘겨받을수 있도록 수정하였습니다.