Skip to content

Conversation

@immonroe
Copy link
Contributor

Description

Fixed a nil pointer dereference that occurs when requesting the hasRated field on the RecipeRevision type without sending an auth token.

The issue was in api/graph/directives.resolvers.go at line 19, where the code was checking session expiry without first verifying that the session exists. When no auth token is provided, session is nil, causing a panic when trying to access the Expiry.Time field.
The fix adds a nil check for the session and simplifies the condition by removing the !required check, allowing the resolver to handle unauthenticated requests gracefully.

Checklist

  • [ x ] I have tested these changes
  • [ x ] I have updated documentation as needed

Related Issues

Closes #71

@immonroe immonroe self-assigned this Aug 10, 2025
Copy link
Contributor

@GV14982 GV14982 left a comment

Choose a reason for hiding this comment

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

Thanks!

@immonroe immonroe merged commit 13acb45 into main Aug 11, 2025
3 checks 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.

Nil pointer de-reference in the hasRated resolver

3 participants