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

MatchError when Parsing XLSX #94

Closed
barakyo opened this issue Aug 19, 2019 · 1 comment
Closed

MatchError when Parsing XLSX #94

barakyo opened this issue Aug 19, 2019 · 1 comment

Comments

@barakyo
Copy link
Contributor

barakyo commented Aug 19, 2019

Hi!

Thanks for the great library. We're using this in production and noticed that we're having an error when trying to parse XLSX files whose columns may be missing some style information (for example a column with no values). The error seems to go away when we directly delete that that column.

This is the error we get:

(MatchError) no match of right hand side value: []

(xlsxir) lib/xlsxir/parse_style.ex:69: Xlsxir.ParseStyle.sax_event_handler/2
(erlsom) xlsxir/deps/erlsom/src/erlsom_sax_utf8.erl:1408: :erlsom_sax_utf8.wrapCallback/2
(erlsom) xlsxir/deps/erlsom/src/erlsom_sax_utf8.erl:936: :erlsom_sax_utf8.parseContentLT/2
(erlsom) xlsxir/deps/erlsom/src/erlsom_sax_utf8.erl:196: :erlsom_sax_utf8.parse/2
(xlsxir) lib/xlsxir/sax_parser.ex:61: Xlsxir.SaxParser.parse/3
(xlsxir) lib/xlsxir/xlsx_file.ex:225: Xlsxir.XlsxFile.parse_styles_to_ets/1
(xlsxir) lib/xlsxir/xlsx_file.ex:65: Xlsxir.XlsxFile.initialize/2
(xlsxir) lib/xlsxir.ex:88: Xlsxir.extract/4

I've attached the spreadsheet, missing_styles.xlsx, where this occurs.

As a heads up, I have a fix for this, but I thought it would better to log an issue and open a PR which fixes this.

@jsonkenl
Copy link
Owner

@barakyo thanks for pointing out this bug and proposing a fix. I'll get it merged ASAP and will publish a new version on hex once I get a chance to look into issue #93.

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

2 participants