GUACMOLE-363: Correct null pointer exception in String comparison; fix style issues.

This commit is contained in:
Nick Couchman
2017-09-07 22:31:37 -04:00
parent 73301901ec
commit 7755241322
2 changed files with 3 additions and 3 deletions

View File

@@ -87,9 +87,9 @@ public class SQLServerAuthenticationProviderModule implements Module {
// Look at the property to choose the correct driver.
if (sqlServerDriver.equals(SQLServerEnvironment.SQLSERVER_DRIVER_JTDS))
JdbcHelper.SQL_Server_jTDS.configure(binder);
else if(sqlServerDriver.equals(SQLServerEnvironment.SQLSERVER_DRIVER_DATADIRECT))
else if (sqlServerDriver.equals(SQLServerEnvironment.SQLSERVER_DRIVER_DATADIRECT))
JdbcHelper.SQL_Server_DataDirect.configure(binder);
else if(sqlServerDriver.equals(SQLServerEnvironment.SQLSERVER_DRIVER_MS))
else if (sqlServerDriver.equals(SQLServerEnvironment.SQLSERVER_DRIVER_MS))
JdbcHelper.SQL_Server_MS_Driver.configure(binder);
else
JdbcHelper.SQL_Server_2005_MS_Driver.configure(binder);

View File

@@ -195,7 +195,7 @@ public class SQLServerEnvironment extends JDBCEnvironment {
// Check driver property is one of the acceptable values.
String driver = getProperty(SQLServerGuacamoleProperties.SQLSERVER_DRIVER);
if (!(driver.equals(SQLSERVER_DRIVER_JTDS) ||
if (driver != null && !(driver.equals(SQLSERVER_DRIVER_JTDS) ||
driver.equals(SQLSERVER_DRIVER_DATADIRECT) ||
driver.equals(SQLSERVER_DRIVER_MS) ||
driver.equals(SQLSERVER_DRIVER_MS_2005)))