`POST /api/qvitter/update_avatar.json` fails when uploading new avatar and having no bio
After successfully uploading the new avatar, and setting it in the DB, the twitter API controller flips a lid because of an empty bio.
logs for posterity
[debug] QUERY OK db=2.0ms
INSERT INTO "objects" ("data","inserted_at","updated_at") VALUES ($1,$2,$3) RETURNING "id" [%{"name" => "b8af1407fcd52175699e234c5bce4bb1e655185f110fd6fbc846d6bccfdb9335.jpeg", "type" => "Image", "url" => [%{"href" => "https://blkstr.ca/5512b421d6c84760b22ab4422b783c36/pleromatest/00c6f276-3012-47be-8547-1621fd640f0b/b8af1407fcd52175699e234c5bce4bb1e655185f110fd6fbc846d6bccfdb9335.jpeg", "mediaType" => "image/jpeg", "type" => "Link"}]}, {{2018, 8, 31}, {0, 22, 22, 678278}}, {{2018, 8, 31}, {0, 22, 22, 678288}}]
[debug] QUERY OK db=0.2ms
begin []
[debug] QUERY OK db=0.6ms
UPDATE "users" SET "avatar" = $1, "updated_at" = $2 WHERE "id" = $3 [%{"name" => "b8af1407fcd52175699e234c5bce4bb1e655185f110fd6fbc846d6bccfdb9335.jpeg", "type" => "Image", "url" => [%{"href" => "https://blkstr.ca/5512b421d6c84760b22ab4422b783c36/pleromatest/00c6f276-3012-47be-8547-1621fd640f0b/b8af1407fcd52175699e234c5bce4bb1e655185f110fd6fbc846d6bccfdb9335.jpeg", "mediaType" => "image/jpeg", "type" => "Link"}]}, {{2018, 8, 31}, {0, 22, 22, 685305}}, 1]
[debug] QUERY OK db=0.9ms
commit []
[info] Sent 500 in 853ms
[error] #PID<0.521.0> running Pleroma.Web.Endpoint (cowboy_protocol) terminated
Server: 0.0.0.0:4000 (http)
Request: POST /api/qvitter/update_avatar.json
** (exit) an exception was raised:
** (FunctionClauseError) no function clause matching in String.contains?/2
(elixir) lib/string.ex:2001: String.contains?(nil, ":a_trusted_friend:")
(elixir) lib/enum.ex:2872: Enum.filter_list/2
(pleroma) lib/pleroma/web/common_api/utils.ex:201: Pleroma.Web.CommonAPI.Utils.emoji_from_profile/1
(pleroma) lib/pleroma/web/common_api/common_api.ex:127: Pleroma.Web.CommonAPI.update/1
(pleroma) lib/pleroma/web/twitter_api/twitter_api_controller.ex:267: Pleroma.Web.TwitterAPI.Controller.update_avatar/2
(pleroma) lib/pleroma/web/twitter_api/twitter_api_controller.ex:1: Pleroma.Web.TwitterAPI.Controller.action/2
(pleroma) lib/pleroma/web/twitter_api/twitter_api_controller.ex:1: Pleroma.Web.TwitterAPI.Controller.phoenix_controller_pipeline/2
(pleroma) lib/pleroma/web/endpoint.ex:1: Pleroma.Web.Endpoint.instrument/4
(phoenix) lib/phoenix/router.ex:278: Phoenix.Router.__call__/1
(pleroma) lib/pleroma/web/endpoint.ex:1: Pleroma.Web.Endpoint.plug_builder_call/2
(pleroma) lib/plug/debugger.ex:122: Pleroma.Web.Endpoint."call (overridable 3)"/2
(pleroma) lib/pleroma/web/endpoint.ex:1: Pleroma.Web.Endpoint.call/2
(plug) lib/plug/adapters/cowboy/handler.ex:16: Plug.Adapters.Cowboy.Handler.upgrade/4
(cowboy) /home/thurloat/workspace/me/pleroma/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4