Add in check to avoid unsightly exceptions.

This commit is contained in:
Mike Auty
2017-07-17 16:19:36 +01:00
parent 8b95480e88
commit f6a55876d0
+5
View File
@@ -44,6 +44,11 @@ class LinuxSymbolFinder(interfaces.automagic.AutomagicInterface):
def _banner_scan(self, context, config_path, requirement, layer_name, progress_callback = None):
"""Accepts a context, config_path and SymbolRequirement, with a constructed layer_name
and scans the layer for linux banners"""
# Bomb out early if there's no banners
if not self._linux_banners:
return
mss = scanners.MultiStringScanner(list(self._linux_banners))
layer = context.memory[layer_name]