Skip to content

Commit

Permalink
Fix parse MOTD without favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
layou233 committed Feb 11, 2024
1 parent 9e01f72 commit adde8fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ android {
applicationId = "com.launium.mcping"
minSdk = 21
targetSdk = 34
versionCode = 8
versionName = "0.3.2"
versionCode = 9
versionName = "0.3.3"
setProperty("archivesBaseName", "MCPing-$versionName")

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MinecraftClient(private val connection: Socket) : Closeable {
readChannel.readFully(statusArray)
val statusObject =
JSON.parse(statusArray, JSONReader.Feature.InitStringFieldAsEmpty) as JSONObject
val serverFavicon = statusObject["favicon"] as String
val serverFavicon = (statusObject["favicon"] as? String) ?: ""
var serverDescriptionText = ""
when (val description = statusObject["description"]) {
is JSONObject -> {
Expand Down

0 comments on commit adde8fa

Please sign in to comment.