Skip to content

Commit 68dc494

Browse files
author
Peter Giacomo Lombardo
authored
Add string safety to application name parsing (#275)
* Add string safety * A more calming debug message
1 parent 43cba41 commit 68dc494

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

instana/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def determine_service_name():
392392

393393
# Get first argument that is not an CLI option
394394
for candidate in sys.argv:
395-
if candidate[0] != '-':
395+
if len(candidate) > 0 and candidate[0] != '-':
396396
basename = candidate
397397
break
398398

@@ -449,7 +449,7 @@ def determine_service_name():
449449
except ImportError:
450450
pass
451451
except Exception:
452-
logger.debug("get_application_name: ", exc_info=True)
452+
logger.debug("non-fatal get_application_name: ", exc_info=True)
453453
finally:
454454
return app_name
455455

0 commit comments

Comments
 (0)