diff --git a/core/dbio/iop/datastream.go b/core/dbio/iop/datastream.go index 0283a49ff..d328f2bb3 100644 --- a/core/dbio/iop/datastream.go +++ b/core/dbio/iop/datastream.go @@ -2510,7 +2510,9 @@ func (it *Iterator) BelowEqualIncrementalVal() bool { // no incremental val or col return false } else if it.incrementalColI == -1 { - it.incrementalColI = it.ds.Columns.GetColumn(it.incrementalCol).Position - 1 + if col := it.ds.Columns.GetColumn(it.incrementalCol); col != nil { + it.incrementalColI = col.Position - 1 + } } if it.incrementalColI == -1 || it.incrementalColI > len(it.ds.Columns) { diff --git a/core/sling/task_func.go b/core/sling/task_func.go index eb02a0a25..b714631c1 100644 --- a/core/sling/task_func.go +++ b/core/sling/task_func.go @@ -187,7 +187,7 @@ func getIncrementalValue(cfg *Config, tgtConn database.Connection, srcConnVarMap // get target columns to match update-key // in case column casing needs adjustment targetCols, _ := pullTargetTableColumns(cfg, tgtConn, false) - if updateCol := targetCols.GetColumn(tgtUpdateKey); updateCol.Name != "" { + if updateCol := targetCols.GetColumn(tgtUpdateKey); updateCol != nil && updateCol.Name != "" { tgtUpdateKey = updateCol.Name // overwrite with correct casing } else if len(targetCols) == 0 { return // target table does not exist diff --git a/core/sling/task_run_read.go b/core/sling/task_run_read.go index 049a080b3..2566fe513 100644 --- a/core/sling/task_run_read.go +++ b/core/sling/task_run_read.go @@ -79,7 +79,7 @@ func (t *TaskExecution) ReadFromDB(cfg *Config, srcConn database.Connection) (df // get source columns to match update-key // in case column casing needs adjustment updateCol := sTable.Columns.GetColumn(cfg.Source.UpdateKey) - if updateCol.Name != "" { + if updateCol != nil && updateCol.Name != "" { cfg.Source.UpdateKey = updateCol.Name // overwrite with correct casing }