diff --git a/pyproject.toml b/pyproject.toml index 0c5dc0f..90f08e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "tungsten-sds" -version = "0.6.0" +version = "0.6.1" description = "An MSDS parser." authors = ["Dennis Pham ", "Brian Lu "] license = "MIT" diff --git a/tungsten/parsers/field_parse.py b/tungsten/parsers/field_parse.py index 1af98da..0317ee8 100644 --- a/tungsten/parsers/field_parse.py +++ b/tungsten/parsers/field_parse.py @@ -16,7 +16,7 @@ def getField(self, field: SdsQueryFieldName, target: dict): target = command.match(target) try: result = post_process(target) - except (KeyError, AttributeError): + except (KeyError, AttributeError, TypeError, IndexError): result = None return result diff --git a/tungsten/parsers/supplier/sigma_aldrich/table_injector.py b/tungsten/parsers/supplier/sigma_aldrich/table_injector.py index 3024ead..8adf7a9 100644 --- a/tungsten/parsers/supplier/sigma_aldrich/table_injector.py +++ b/tungsten/parsers/supplier/sigma_aldrich/table_injector.py @@ -103,7 +103,10 @@ def generate_injections(self, io: IO[bytes]) -> list[Injection]: def reject_table(table: TabulaTable) -> bool: # TODO this is a temporary solution # TODO reject more tables that are false positives - return table.data[1][0].text.strip()[1] == ")" + try: + return table.data[1][0].text.strip()[1] == ")" + except IndexError: + return True @dataclass