Skip to content

Empty inputs should not be allowed #58

@nromashchenko

Description

@nromashchenko

Version: 2.1.1

omamer doesn't check if the input file provided by -q is empty, and crashes with:

Traceback (most recent call last):
  File "/home/nikolai/dev/omamer/.pixi/envs/default/bin/omamer", line 33, in <module>
    sys.exit(load_entry_point('omamer', 'console_scripts', 'omamer')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nikolai/dev/omamer/omamer/main.py", line 306, in main
    args.func(args)
  File "/home/nikolai/dev/omamer/omamer/_runners.py", line 256, in search
    search_rate = sum(map(lambda x: x[0], search_times)) / sum(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ZeroDivisionError: division by zero

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions