linkedin/qark

AttributeError: 'NoneType' object has no attribute 'startswith'

mkaraoz opened this issue · 0 comments

Hi,

When I run qark against java code I get the error below. When I try it with the apk file it gets stuck at some point and waits until I cancel the job.

System: Ubuntu 18.04
Installed with: pip install --user qark
python version 2.7

I also tried installing with pip3 and compiling the code. I got the same errors.

qark --java .
Decompiling...
Running scans...
Traceback (most recent call last):
  File "/home/mk/.local/bin/qark", line 11, in <module>
    sys.exit(cli())
  File "/home/mk/.local/lib/python2.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/mk/.local/lib/python2.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/mk/.local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/mk/.local/lib/python2.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/mk/.local/lib/python2.7/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/mk/.local/lib/python2.7/site-packages/qark/qark.py", line 90, in cli
    scanner.run()
  File "/home/mk/.local/lib/python2.7/site-packages/qark/scanner/scanner.py", line 64, in run
    self._run_checks(plugins)
  File "/home/mk/.local/lib/python2.7/site-packages/qark/scanner/scanner.py", line 78, in _run_checks
    current_file_subject.notify(filepath)
  File "/home/mk/.local/lib/python2.7/site-packages/qark/scanner/scanner.py", line 125, in notify
    observer.update(file_path, call_run=True)
  File "/home/mk/.local/lib/python2.7/site-packages/qark/scanner/plugin.py", line 239, in update
    super(CoroutinePlugin, self).update(file_path)
  File "/home/mk/.local/lib/python2.7/site-packages/qark/scanner/plugin.py", line 185, in update
    JavaASTPlugin.java_ast = javalang.parse.parse(self.file_contents)
  File "/home/mk/.local/lib/python2.7/site-packages/javalang/parse.py", line 52, in parse
    parser = Parser(tokens)
  File "/home/mk/.local/lib/python2.7/site-packages/javalang/parser.py", line 95, in __init__
    self.tokens = util.LookAheadListIterator(tokens)
  File "/home/mk/.local/lib/python2.7/site-packages/javalang/util.py", line 92, in __init__
    self.list = list(iterable)
  File "/home/mk/.local/lib/python2.7/site-packages/javalang/tokenizer.py", line 508, in tokenize
    if comment.startswith("/**"):
AttributeError: 'NoneType' object has no attribute 'startswith'