diff 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
line wrap: on
line diff
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java
@@ -1448,9 +1448,11 @@ public class MonetConnection extends Mon
 	 */
 	@Override
 	public void setClientInfo(Properties props) throws java.sql.SQLClientInfoException {
-		for (Entry<Object, Object> entry : props.entrySet()) {
-			setClientInfo(entry.getKey().toString(),
-					entry.getValue().toString());
+		if (props != null) {
+			for (Entry<Object, Object> entry : props.entrySet()) {
+				setClientInfo(entry.getKey().toString(),
+						entry.getValue().toString());
+			}
 		}
 	}