Skip to content
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: null check in ListenerCollection notify method #1661

Merged
merged 5 commits into from
Aug 28, 2024
Merged

Conversation

kkocel
Copy link
Contributor

@kkocel kkocel commented Aug 26, 2024

Fix for the issue I've encountered in the wild:

Caused by: java.lang.NullPointerException: Cannot invoke "java.util.function.Consumer.accept(Object)" because "listener" is null
    at com.microsoft.playwright.impl.ListenerCollection.notify(ListenerCollection.java:44)
    at com.microsoft.playwright.impl.PageImpl.didClose(PageImpl.java:234)
    at com.microsoft.playwright.impl.PageImpl.handleEvent(PageImpl.java:222)
    at com.microsoft.playwright.impl.Connection.dispatch(Connection.java:292)
    at com.microsoft.playwright.impl.Connection.processOneMessage(Connection.java:211)
    at com.microsoft.playwright.impl.ChannelOwner.runUntil(ChannelOwner.java:118)
    at com.microsoft.playwright.impl.Connection.sendMessage(Connection.java:130)
    at com.microsoft.playwright.impl.ChannelOwner.sendMessage(ChannelOwner.java:106)
    at com.microsoft.playwright.impl.FrameImpl.fillImpl(FrameImpl.java:335)
    at com.microsoft.playwright.impl.FrameImpl.lambda$fill$14(FrameImpl.java:325)
    at com.microsoft.playwright.impl.LoggingSupport.lambda$withLogging$0(LoggingSupport.java:36)
    at com.microsoft.playwright.impl.LoggingSupport.withLogging(LoggingSupport.java:47)
    at com.microsoft.playwright.impl.ChannelOwner.withLogging(ChannelOwner.java:89)
    at com.microsoft.playwright.impl.LoggingSupport.withLogging(LoggingSupport.java:35)
    at com.microsoft.playwright.impl.FrameImpl.fill(FrameImpl.java:325)
    at com.microsoft.playwright.impl.LocatorImpl.fill(LocatorImpl.java:235)
    at com.microsoft.playwright.Locator.fill(Locator.java:2988)

@kkocel
Copy link
Contributor Author

kkocel commented Aug 26, 2024

@microsoft-github-policy-service agree company="Paramount"

Copy link
Member

@yury-s yury-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a fix for #1659 ?

@kkocel
Copy link
Contributor Author

kkocel commented Aug 26, 2024

Is this a fix for #1659 ?

nope, it's another bug I've encountered

@kkocel
Copy link
Contributor Author

kkocel commented Aug 27, 2024

@yury-s I've seen that some tests randomly crashed and I don't have permissions to restart them.

@yury-s yury-s merged commit b81b144 into microsoft:main Aug 28, 2024
14 of 19 checks passed
@yury-s
Copy link
Member

yury-s commented Aug 28, 2024

@yury-s I've seen that some tests randomly crashed and I don't have permissions to restart them.

These are old flakes, your PR is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants