Skip to content

Commit

Permalink
fix:
Browse files Browse the repository at this point in the history
1、ck filterValue NPE protection
2、mysql version NPE protection
  • Loading branch information
jarad0628 committed Aug 25, 2023
1 parent 65fb32f commit 7c248b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.tapdata.common.CommonColumn;
import io.tapdata.entity.schema.TapField;
import io.tapdata.entity.utils.DataMap;
import io.tapdata.kit.EmptyKit;


/**
Expand Down Expand Up @@ -33,7 +34,7 @@ public MysqlColumn withVersion(String version) {

@Override
protected Boolean isNullable() {
if ("5.6".compareTo(version) > 0) {
if (EmptyKit.isNull(version) || "5.6".compareTo(version) > 0) {
return true;
}
return "YES".equals(this.nullable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ protected String getDeleteSql(Map<String, Object> before, boolean containsNull)

@Override
protected Object filterValue(Object value, String dataType) {
if (EmptyKit.isNull(dataType)) {
return value;
}
if (dataType.contains("Int")) {
if (value instanceof Float) {
return ((Float) value).intValue();
Expand Down

0 comments on commit 7c248b4

Please sign in to comment.