logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: adc38078dde102d4b6e98d364ada47fa3dd3f22c
parent: dae0af1fd2499a2eca2becbbec13356a27c4e81c
Author: Eugen Rochko <eugen@zeonfederated.com>
Date:   Sun, 24 Sep 2017 04:09:32 +0200

Make sure nil IDs to not get cast to empty string in REST API (#5068)


Diffstat:

Mapp/serializers/rest/application_serializer.rb2+-
Mapp/serializers/rest/status_serializer.rb4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/serializers/rest/application_serializer.rb b/app/serializers/rest/application_serializer.rb @@ -9,7 +9,7 @@ class REST::ApplicationSerializer < ActiveModel::Serializer end def client_id - object.uid.to_s + object.uid end def client_secret diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb @@ -24,11 +24,11 @@ class REST::StatusSerializer < ActiveModel::Serializer end def in_reply_to_id - object.in_reply_to_id.to_s + object.in_reply_to_id&.to_s end def in_reply_to_account_id - object.in_reply_to_account_id.to_s + object.in_reply_to_account_id&.to_s end def current_user?