mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2025-07-14 07:30:29 +03:00
Avoid a crash when max_char defined by the instance is not an integer
This commit is contained in:
parent
749aefe858
commit
02a066a253
1 changed files with 1 additions and 1 deletions
|
@ -559,7 +559,7 @@ public class MastodonHelper {
|
||||||
return val;
|
return val;
|
||||||
} else {
|
} else {
|
||||||
if (instanceInfo != null) {
|
if (instanceInfo != null) {
|
||||||
max_car = instanceInfo.max_toot_chars != null ? Integer.parseInt(instanceInfo.max_toot_chars) : instanceInfo.configuration.statusesConf.max_characters;
|
max_car = instanceInfo.max_toot_chars != null && instanceInfo.max_toot_chars.matches("\\d+") ? Integer.parseInt(instanceInfo.max_toot_chars) : instanceInfo.configuration.statusesConf.max_characters;
|
||||||
} else {
|
} else {
|
||||||
max_car = 500;
|
max_car = 500;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue