Fix: #442 カスタム絵文字のaliasesにnullが入る場合がある (#443)

* Fix: #442 カスタム絵文字のaliasesにnullが入る場合がある

* Fix test

* WebのほうにもNULLチェックを追加

* ローカルのエイリアス名を編集するところもついでにスリムに
This commit is contained in:
KMY(雪あすか) 2024-01-10 09:43:56 +09:00 committed by GitHub
parent 650d40cb24
commit dc73c30d2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 111 additions and 12 deletions

View file

@ -51,6 +51,14 @@ module JsonLdHelper
end
end
def as_array_ex(value)
if value.is_a?(Hash)
[]
else
as_array(value)
end
end
def value_or_id(value)
value.is_a?(String) || value.nil? ? value : value['id']
end