1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2025-02-01 01:47:01 +01:00

refs #816 Fix visibility detector when the response does not contain default visibility

This commit is contained in:
AkiraFukushima 2020-03-18 23:24:36 +09:00
parent f9653647e4
commit d662735729

View File

@ -368,7 +368,7 @@ const actions: ActionTree<NewTootState, RootState> = {
)
const res = await client.verifyAccountCredentials()
const visibility: VisibilityType | undefined = (Object.values(Visibility) as Array<VisibilityType>).find(v => {
return v.key === res.data.source!.privacy
return res.data.source !== undefined && v.key === res.data.source.privacy
})
if (visibility === undefined) {
throw new Error('Visibility value is invalid')