Fix error for Swift targets without ObjcProvider
PiperOrigin-RevId: 201954608
diff --git a/src/TulsiGenerator/Bazel/tulsi/tulsi_aspects.bzl b/src/TulsiGenerator/Bazel/tulsi/tulsi_aspects.bzl
index 4afcabd..4aa4514 100644
--- a/src/TulsiGenerator/Bazel/tulsi/tulsi_aspects.bzl
+++ b/src/TulsiGenerator/Bazel/tulsi/tulsi_aspects.bzl
@@ -518,7 +518,8 @@
def _collect_module_maps(target):
"""Returns a depset of Clang module maps found on the given target."""
maps = depset()
- if LegacySwiftInfo in target or SwiftInfo in target:
+ if ((LegacySwiftInfo in target or SwiftInfo in target) and
+ apple_common.Objc in target):
objc = target[apple_common.Objc]
for module_maps in _getattr_as_list(objc, "module_map"):
maps += module_maps