-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Properly fetch view interaction if it was found under a root #824
Conversation
} catch (e: PerformException) { | ||
// Perform Exception means nothing was found. Return empty list | ||
emptyList() | ||
} | ||
} | ||
Strategy.VIEWMATCHER -> { | ||
val matcherJson = selector.toJsonMatcher() | ||
views = try { | ||
return try { | ||
@Suppress("UNCHECKED_CAST") | ||
getViews(root, matcherJson.query.matcher as Matcher<View>, findOne, matcherJson.query.scope as Matcher<Root>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this scope be nullable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is nullable. Does something looks suspicious here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I not mistaken the cast should be Matcher<Root>?
, when the scope is null it will throw an Exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should work just fine, as?
is needed to do cast from types other than null: https://stackoverflow.com/questions/50836017/safe-cast-vs-cast-to-nullable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can revert the test code change right now (until figured out this change was expected or not)
ok, I'll revert the change. This is anyway an unrelated issue |
🎉 This PR is included in version 2.12.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Addresses #821 (comment)