Skip to content

Commit 960ab92

Browse files
Dan-Maormykola-mokhnach
authored andcommitted
fix: Throwing excpetion when looking for active application only if element is null (#219)
1 parent 8c3719b commit 960ab92

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

WebDriverAgentLib/FBApplication.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ + (instancetype)fb_activeApplicationWithDefaultBundleId:(nullable NSString *)bun
8181
}
8282
if (nil == activeApplicationElement && activeApplicationElements.count > 0) {
8383
activeApplicationElement = [activeApplicationElements firstObject];
84-
} else {
84+
}
85+
if (nil == activeApplicationElement) {
8586
NSString *errMsg = @"No applications are currently active";
8687
@throw [NSException exceptionWithName:FBElementNotVisibleException reason:errMsg userInfo:nil];
8788
}

0 commit comments

Comments
 (0)