Fix 500 in publicsController
This commit is contained in:
parent
ae22dcc274
commit
1666843aa9
2 changed files with 5 additions and 1 deletions
|
|
@ -49,7 +49,7 @@ class PublicsController < ApplicationController
|
|||
|
||||
person = Person.where(:guid => params[:guid]).first
|
||||
|
||||
if person.owner_id.nil?
|
||||
if person.nil? || person.owner_id.nil?
|
||||
Rails.logger.error("Received post for nonexistent person #{params[:guid]}")
|
||||
render :nothing => true, :status => 404
|
||||
return
|
||||
|
|
|
|||
|
|
@ -55,6 +55,10 @@ describe PublicsController do
|
|||
post :receive, "guid" => @person.guid.to_s, "xml" => xml
|
||||
response.should be_not_found
|
||||
end
|
||||
it 'returns a 404 if no person is found' do
|
||||
post :receive, :guid => '2398rq3948yftn', :xml => xml
|
||||
response.should be_not_found
|
||||
end
|
||||
end
|
||||
|
||||
describe '#hcard' do
|
||||
|
|
|
|||
Loading…
Reference in a new issue