From: Sadposter Date: Wed, 4 Sep 2019 14:57:42 +0000 (+0100) Subject: don't try to truncate non-strings X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=cb99cfcc65f57f0044117ebd12d040488343d9ef;p=akkoma don't try to truncate non-strings --- diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 87e56b5b4..e2ebce6fc 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -175,7 +175,7 @@ defmodule Pleroma.User do end defp truncate_if_exists(params, key, max_length) do - if Map.has_key?(params, key) do + if Map.has_key?(params, key) and is_binary(params[key]) do {value, _chopped} = String.split_at(params[key], max_length) Map.put(params, key, value) else