From 6a09af169ebb1cb2ab0c65b887ccbd66347cbedc Mon Sep 17 00:00:00 2001 From: Martin Redington Date: Fri, 31 Mar 2023 19:59:47 +0100 Subject: [PATCH] Fix crash when parsing apple/swift (#4828) --- .../Rules/Idiomatic/GenericTypeNameRule.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/SwiftLintFramework/Rules/Idiomatic/GenericTypeNameRule.swift b/Source/SwiftLintFramework/Rules/Idiomatic/GenericTypeNameRule.swift index 64b05b631..2cfe52b0b 100644 --- a/Source/SwiftLintFramework/Rules/Idiomatic/GenericTypeNameRule.swift +++ b/Source/SwiftLintFramework/Rules/Idiomatic/GenericTypeNameRule.swift @@ -66,7 +66,7 @@ private extension GenericTypeNameRule { override func visitPost(_ node: GenericParameterSyntax) { let name = node.name.text - guard !configuration.shouldExclude(name: name) else { return } + guard !name.isEmpty, !configuration.shouldExclude(name: name) else { return } let allowedSymbols = configuration.allowedSymbols.union(.alphanumerics) if !allowedSymbols.isSuperset(of: CharacterSet(charactersIn: name)) {