Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,14 @@ public void drawVolLine(Canvas canvas, Paint paint, float startX, float startVal
* @return
*/
public KLineEntity getItem(int position) {
return configManager.modelArray.get(position);
int size = configManager.modelArray == null ? 0 : configManager.modelArray.size();
if (size <= 0) {
KLineEntity empty = new KLineEntity();
empty.Date = "";
return empty;
}
int safeIndex = Math.max(0, Math.min(position, size - 1));
return configManager.modelArray.get(safeIndex);
}

/**
Expand Down