Skip to content

Commit

Permalink
Fix possible NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgio committed Jun 5, 2019
1 parent a5d3e58 commit f72038c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/org/chorusmc/chorus/connection/FTPRemoteConnection.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class FTPRemoteConnection(override val ip: String, override val username: String
}

override fun getFiles(loc: String): List<RemoteFile> {
var list = client!!.listFiles(loc).map {RemoteFile(it.name, it.isDirectory)}
var list = client?.listFiles(loc)?.map {RemoteFile(it.name, it.isDirectory)} ?: emptyList()
if(!list.map {it.filename}.contains("..")) {
list += RemoteFile("..", true)
}
Expand Down

0 comments on commit f72038c

Please sign in to comment.