1
0
mirror of https://github.com/tateisu/SubwayTooter synced 2025-01-31 02:54:57 +01:00

クラッシュレポート対応

This commit is contained in:
tateisu 2019-11-15 13:10:44 +09:00
parent 9864550ff7
commit 8b16d5fd69

View File

@ -1000,18 +1000,16 @@ class TootApiClient(
if(client_credential?.isEmpty() != false) { if(client_credential?.isEmpty() != false) {
val resultSub = getClientCredential(client_info) val resultSub = getClientCredential(client_info)
client_credential = resultSub?.string client_credential = resultSub?.string
if(client_credential?.isNotEmpty() == true) { if(client_credential?.isEmpty() != false) return resultSub
try {
client_info.put(KEY_CLIENT_CREDENTIAL, client_credential) client_info.put(KEY_CLIENT_CREDENTIAL, client_credential)
}
try {
ClientInfo.save(instance, client_name, client_info.toString()) ClientInfo.save(instance, client_name, client_info.toString())
} catch(ignored : JSONException) { } catch(ignored : JSONException) {
} }
}
}
ClientInfo.save(instance, client_name, client_info.toString())
result.data = client_info result.data = client_info
return result return result
} }
@ -1174,14 +1172,13 @@ class TootApiClient(
reason : String? reason : String?
) : TootApiResult? { ) : TootApiResult? {
val client_credential = client_info.parseString(KEY_CLIENT_CREDENTIAL)
?: error("missing client credential")
val result = TootApiResult.makeWithCaption(this.instance) val result = TootApiResult.makeWithCaption(this.instance)
if(result.error != null) return result if(result.error != null) return result
log.d("createUser2Mastodon: client is : ${client_info}") log.d("createUser2Mastodon: client is : ${client_info}")
val client_credential = client_info.parseString(KEY_CLIENT_CREDENTIAL)
?: return result.setError("createUser2Mastodon(): missing client credential")
if(! sendRequest(result) { if(! sendRequest(result) {