Skip to content
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

CHE-202_bug_causes_array_push_error #59

Merged
merged 2 commits into from
Jun 13, 2024

Conversation

BuggerBugs
Copy link
Collaborator

No description provided.

@BuggerBugs
Copy link
Collaborator Author

BuggerBugs commented Jun 12, 2024

Error was caught and fixed in chessis.fun. Description is here for logging purposes!:

Error is sometimes thrown at specific cases which causes analysis to fail.
Errorwas that we were pushing into a null object.
Apparently it's because within captures.ts KDRatioMetric, within the aggregate() function, pieceWithHighestKDRatio and pieceWithHighestKDRatioValues were initialised as null(). The following case probably triggered the error:

maxKDRatio is initalised as 0.

The First value of KDRatios[uas] iterating through the for loop is 0.

That means KDRatios[uas]===maxKDRatio, hence we push the UAS symbol of said KDRatio into pieceWithHighestKDRatio. BUT pieceWithHighestKDRatio is null. Hence we are trying to push into a null object in this case.

The exact same issue occurs with pieceWithHighestKDRatioValues.

Fix: Initialised both piece pieceWithHighestKDRatio and pieceWithHighestKDRatioValues as empty arrays instead of null.

@BuggerBugs BuggerBugs requested review from bennyrubanov and EllAchE and removed request for EllAchE June 12, 2024 23:06
src/queue.js Outdated
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a new file? why is it being presented as such?

Copy link
Collaborator Author

@BuggerBugs BuggerBugs Jun 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BuggerBugs BuggerBugs merged commit 9cf5a27 into main Jun 13, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants