Skip to content
Permalink
Browse files

Fix possible NPE

  • Loading branch information...
iAmGio committed Jun 5, 2019
1 parent a5d3e58 commit f72038cac97d0eba054ad11ba2b87c33c01f5999
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/org/chorusmc/chorus/connection/FTPRemoteConnection.kt
@@ -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)
}

0 comments on commit f72038c

Please sign in to comment.
You can’t perform that action at this time.