mirror of
https://github.com/mamoe/mirai.git
synced 2025-04-24 20:43:33 +08:00
Apply suggestions from code review
This commit is contained in:
parent
5bb86cf84f
commit
e6a953e05f
@ -72,9 +72,9 @@ public fun <T> MiraiFile.loadNotBlankAs(
|
||||
if (!this.exists() || this.length == 0L) {
|
||||
return null
|
||||
}
|
||||
return try{
|
||||
return try {
|
||||
stringFormat.decodeFromString(serializer, this.readText())
|
||||
}catch(e:Throwable){//broken file
|
||||
} catch (e: Throwable) { //broken file
|
||||
e.printStackTrace()
|
||||
null
|
||||
}
|
||||
@ -87,9 +87,9 @@ public fun <T> MiraiFile.loadNotBlankAs(
|
||||
if (!this.exists() || this.length == 0L) {
|
||||
return null
|
||||
}
|
||||
return try{
|
||||
return try {
|
||||
binaryFormat.decodeFromByteArray(serializer, this.readBytes())
|
||||
}catch(e:Throwable){//broken file
|
||||
} catch (e: Throwable) { //broken file
|
||||
e.printStackTrace()
|
||||
null
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user