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

AgentEinstein/add error checking #863

Merged
merged 6 commits into from
Nov 13, 2023
Merged

Conversation

AgentEinstein
Copy link
Contributor

image

@AgentEinstein AgentEinstein self-assigned this Nov 5, 2023
@AgentEinstein AgentEinstein linked an issue Nov 5, 2023 that may be closed by this pull request
@@ -37,6 +37,10 @@ const Team = ({ user, setUser }) => {
};

const handleJoin = () => {
if (id.team.length === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

u can just check for an empty string instead of character comparison

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -37,6 +37,10 @@ const Team = ({ user, setUser }) => {
};

const handleJoin = () => {
if (id.team == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

triple equals and it should just be checking for empty string and not null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image
That doesn't seem to work. Instead, this jumps to the very last else statement on line 55.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On the other hand, !id.team seems to work, did you prefer that implementation instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

what are the initial values for the id.team?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's probably empty

Copy link
Contributor

Choose a reason for hiding this comment

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

check the values and do a type check for it instead of a general null check

@shahdivyank shahdivyank merged commit 76b362f into dev Nov 13, 2023
6 checks passed
@shahdivyank shahdivyank deleted the AgentEinstein/AddErrorChecking branch November 13, 2023 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Error Checking
2 participants