Syosset / syosset

🖥️ The official website of Syosset High School from 2017-2019, powered by Rails 5.
https://web.archive.org/web/20190414065933/https://syosseths.com/
MIT License
9 stars 2 forks source link

Sending support messages throws error as bot if user is not set #124

Open kailan opened 6 years ago

kailan commented 6 years ago

https://sentry.io/syosset/syossethscom/issues/471090253/

Mongoid::Errors::InvalidFind: 
message:
  Calling Document.find with nil is invalid.
summary:
  Document.find expects the parameters to be 1 or more ids, and will return a single document if 1 id is provided, otherwise an array of documents if multiple ids are provided.
resolution:
  Most likely this is caused by passing parameters directly through to the find, and the parameter either is not present or the key from which it is accessed is incorrect.
  app/controllers/message_threads_controller.rb:22:in `send_message'
    user = User.find(params[:user_id])
...
(66 additional frame(s) were not displayed)

Mongoid::Errors::InvalidFind: 
message:
  Calling Document.find with nil is invalid.
summary:
  Document.find expects the parameters to be 1 or more ids, and will return a single document if 1 id is provided, otherwise an array of documents if multiple ids are provided.
resolution:
  Most likely this is caused by passing parameters directly through to the find, and the parameter either is not present or the key from which it is accessed is incorrect.