Merge pull request #231 from alexwangx/alexwang

fixed issue #227 , fixed Mysql5.1.73 throw NullPointerException
This commit is contained in:
agapple
2016-12-02 18:06:36 +08:00
committed by GitHub
@@ -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;
}