Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WorkSheet.Row(i int) method panic #66

Open
xiaoxfan opened this issue May 21, 2020 · 3 comments
Open

WorkSheet.Row(i int) method panic #66

xiaoxfan opened this issue May 21, 2020 · 3 comments

Comments

@xiaoxfan
Copy link

WorkSheet.Row(i int) method panic

0<= j < MaxRow ,why it panic

for i := 0; i < xlFile.NumSheets(); i++ {
	if sheet1 := xlFile.GetSheet(i); sheet1 != nil {
		for j := 0; j < (int(sheet1.MaxRow)); j++ {
			row1 := sheet1.Row(j) // panic
			for k := row1.FirstCol(); k < row1.LastCol(); k++ {
				fmt.Print(row1.Col(k), "\t")
			}
			fmt.Print("\n")
		}
	}
}
func (w *WorkSheet) Row(i int) *Row {
	row := w.rows[uint16(i)] // sometimes row is nil
	row.wb = w.wb
	return row
}
@liuxinghen
Copy link

I ran into this problem as well, this is because the row in your excel file is a blank row without any valid cell value and the row is in the middle of all rows. I think this is a bug.

@uorji3
Copy link

uorji3 commented May 26, 2021

I was having the same issue. The v0.0.1 release has the bug but it was fixed in 7ea8f41#diff-12d0b89bd33127025def81e7519e3efa0184ee7bef5bcd3ca3a83826459f2fb3.

I think we just need to update the version.

@KiddoV
Copy link

KiddoV commented Apr 17, 2023

Please update this!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants