diff --git a/slither/core/declarations/function.py b/slither/core/declarations/function.py index c0f5b2687..b9e981375 100644 --- a/slither/core/declarations/function.py +++ b/slither/core/declarations/function.py @@ -143,7 +143,7 @@ class Function(ChildContract, ChildInheritance, SourceMapping): """ str: function name """ - if self._function_type == FunctionType.CONSTRUCTOR: + if self._name == '' and self._function_type == FunctionType.CONSTRUCTOR: return 'constructor' elif self._function_type == FunctionType.FALLBACK: return 'fallback' diff --git a/slither/core/slither_core.py b/slither/core/slither_core.py index f10831ffe..2747416fd 100644 --- a/slither/core/slither_core.py +++ b/slither/core/slither_core.py @@ -61,7 +61,7 @@ class Slither(Context): :param path: :return: """ - if path in self.crytic_compile.src_content: + if self.crytic_compile and path in self.crytic_compile.src_content: self.source_code[path] = self.crytic_compile.src_content[path] else: with open(path, encoding='utf8', newline='') as f: