mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-17 14:05:23 +02:00
[ftp] Avoid NPE when remote doesnt send system type
This commit is contained in:
parent
76ff946105
commit
3db44ba3b2
1 changed files with 53 additions and 46 deletions
|
@ -91,6 +91,10 @@ public class FTPClientConfigFactory implements IFTPClientConfigFactory {
|
||||||
*/
|
*/
|
||||||
public IFTPClientConfigProxy getFTPClientConfig(String parser, String systemName)
|
public IFTPClientConfigProxy getFTPClientConfig(String parser, String systemName)
|
||||||
{
|
{
|
||||||
|
if (systemName == null) {
|
||||||
|
// avoid NPE if systemName could not be determined
|
||||||
|
systemName = ""; //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
FTPClientConfigProxy foundFTPClientConfigProxy = null;
|
FTPClientConfigProxy foundFTPClientConfigProxy = null;
|
||||||
|
|
||||||
|
@ -220,7 +224,10 @@ public class FTPClientConfigFactory implements IFTPClientConfigFactory {
|
||||||
public FTPFileEntryParser createFileEntryParser(String key) throws ParserInitializationException {
|
public FTPFileEntryParser createFileEntryParser(String key) throws ParserInitializationException {
|
||||||
|
|
||||||
FTPFileEntryParser entryParser = null;
|
FTPFileEntryParser entryParser = null;
|
||||||
|
if (key == null) {
|
||||||
|
// avoid NPE in containsKey when the SYST command returned null
|
||||||
|
key = ""; //$NON-NLS-1$
|
||||||
|
}
|
||||||
if(!ftpParsers.containsKey(key))
|
if(!ftpParsers.containsKey(key))
|
||||||
{
|
{
|
||||||
entryParser = defaultFTPEntryParser;
|
entryParser = defaultFTPEntryParser;
|
||||||
|
|
Loading…
Add table
Reference in a new issue