comparison src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java @ 47:562dbfb2fee8

Prevent null pointer exception by checking props argument Extended Changelog for changes made to setClientInfo() methods
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Thu, 10 Nov 2016 18:58:27 +0100 (2016-11-10)
parents c2bf983dc79b
children e605cdd6373f 83aee4f60649
comparison
equal deleted inserted replaced
46:5d4524c27902 47:562dbfb2fee8
1446 * or this method is called on a closed connection 1446 * or this method is called on a closed connection
1447 * @since 1.6 1447 * @since 1.6
1448 */ 1448 */
1449 @Override 1449 @Override
1450 public void setClientInfo(Properties props) throws java.sql.SQLClientInfoException { 1450 public void setClientInfo(Properties props) throws java.sql.SQLClientInfoException {
1451 for (Entry<Object, Object> entry : props.entrySet()) { 1451 if (props != null) {
1452 setClientInfo(entry.getKey().toString(), 1452 for (Entry<Object, Object> entry : props.entrySet()) {
1453 entry.getValue().toString()); 1453 setClientInfo(entry.getKey().toString(),
1454 entry.getValue().toString());
1455 }
1454 } 1456 }
1455 } 1457 }
1456 1458
1457 1459
1458 //== Java 1.7 methods (JDBC 4.1) 1460 //== Java 1.7 methods (JDBC 4.1)