Skip to content

Commit

Permalink
Check if slug is neither undefined nor null before validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jade Chang committed Jan 6, 2024
1 parent 35b47be commit 4457be1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/graphql/mutations/UpdateUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {
throw new Error(`There's nothing to update`);

// Ensure uniqueness of slug
if (slug !== undefined) {
if (slug !== undefined && slug !== null) {
try {
await assertSlugIsValid(slug, userId);
} catch (e) {
Expand Down

0 comments on commit 4457be1

Please sign in to comment.