mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-15 18:02:58 +08:00
fix: hostConfigEntry NPE
This commit is contained in:
@@ -2,6 +2,7 @@ package app.termora.transport
|
||||
|
||||
import app.termora.Disposable
|
||||
import org.apache.commons.io.IOUtils
|
||||
import org.apache.commons.lang3.ObjectUtils
|
||||
import org.apache.commons.net.io.CopyStreamEvent
|
||||
import org.apache.commons.net.io.CopyStreamListener
|
||||
import org.apache.commons.net.io.Util
|
||||
@@ -105,7 +106,10 @@ abstract class Transport(
|
||||
if (fileSystem is SftpFileSystem) {
|
||||
val clientSession = fileSystem.session
|
||||
if (clientSession is JGitClientSession) {
|
||||
return clientSession.hostConfigEntry.host
|
||||
return ObjectUtils.defaultIfNull(
|
||||
clientSession.hostConfigEntry.host,
|
||||
clientSession.hostConfigEntry.hostName
|
||||
)
|
||||
}
|
||||
}
|
||||
return "file"
|
||||
|
||||
Reference in New Issue
Block a user