fixed issue #227 , fixed Mysql5.1.73 throw NullPointerException

This commit is contained in:
alexwang
2016-12-01 17:39:51 +08:00
parent e67f27018c
commit bc7927fe75

View File

@@ -279,8 +279,9 @@ public class MysqlConnection implements ErosaConnection {
}
List<String> columnValues = rs.getFieldValues();
if(columnValues.get(0).toUpperCase().equals("CRC32")){
binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_CRC32;
if (columnValues.size() > 0 && columnValues.get(0) != null
&& columnValues.get(0).toUpperCase().equals("CRC32")) {
binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_CRC32;
}else{
binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_OFF;
}