We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7cbc479 + 5affc8c commit a838a30Copy full SHA for a838a30
1 file changed
analyzer/codechecker_analyzer/cli/fixit.py
@@ -377,11 +377,15 @@ def main(args):
377
"arriving from standard input.")
378
sys.exit(1)
379
380
- try:
381
- reports = None if sys.stdin.isatty() else json.loads(sys.stdin.read())
382
- except json.decoder.JSONDecodeError as ex:
383
- LOG.error("JSON format error on standard input: %s", ex)
384
- sys.exit(1)
+ reports = None
+ if not sys.stdin.isatty():
+ stdin_data = sys.stdin.read().strip()
+ if stdin_data:
+ try:
385
+ reports = json.loads(stdin_data)
386
+ except json.decoder.JSONDecodeError as ex:
387
+ LOG.error("JSON format error on standard input: %s", ex)
388
+ sys.exit(1)
389
390
# "CodeChecker fixit" can be applied on the output of
391
# "CodeChecker cmd diff" command. Earlier this was a simple list of
0 commit comments