From df29fb1c245e08ccaf5aba21657e7c60b0ff621b Mon Sep 17 00:00:00 2001 From: YoloMao Date: Sun, 29 Sep 2024 09:37:16 +0800 Subject: [PATCH] fix: no empty path for custom event --- GrowingAutotrackerCore/Page/GrowingPageManager.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/GrowingAutotrackerCore/Page/GrowingPageManager.m b/GrowingAutotrackerCore/Page/GrowingPageManager.m index 5fec2fef..79a68a50 100644 --- a/GrowingAutotrackerCore/Page/GrowingPageManager.m +++ b/GrowingAutotrackerCore/Page/GrowingPageManager.m @@ -65,9 +65,8 @@ - (void)start { - (void)growingEventManagerEventWillBuild:(GrowingBaseBuilder *_Nullable)builder { if (builder) { if ([builder isMemberOfClass:[GrowingCustomBuilder class]]) { - if (self.lastPagePath && self.lastPagePath.length > 0) { - ((GrowingCustomBuilder *)builder).setPath(self.lastPagePath); - } + NSString *path = self.lastPagePath && self.lastPagePath.length > 0 ? self.lastPagePath.copy : @"/"; + ((GrowingCustomBuilder *)builder).setPath(path); } else if ([builder isMemberOfClass:[GrowingPageBuilder class]]) { GrowingPageBuilder *pageBuilder = (GrowingPageBuilder *)builder; self.lastPagePath = pageBuilder.path;