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

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot read field "x" because "rc" is null #5056

Open
Omico opened this issue Jul 2, 2024 · 2 comments
Assignees
Labels
bug Something isn't working input Touch, mouse, keyboard input related p:critical Critical priority regression reproduced

Comments

@Omico
Copy link
Contributor

Omico commented Jul 2, 2024

Affected platforms

  • Desktop (Windows)

Versions

  • Libraries:
    • Compose Multiplatform version: 1.7.0-dev1703
  • Kotlin version: 2.0.0
  • JDK (for desktop issues): 17

To Reproduce
Steps to reproduce the behavior:
Run this & input any chars.

@OptIn(ExperimentalMaterial3Api::class)
fun main() {
   singleWindowApplication {
       Scaffold(
           topBar = {
               TopAppBar(
                   title = {
                       var title by remember { mutableStateOf("Default") }
                       BasicTextField(
                           value = title,
                           onValueChange = { title = it },
                           textStyle = LocalTextStyle.current,
                           singleLine = true,
                           modifier = Modifier.fillMaxWidth(),
                       )
                   },
               )
           },
           content = {}
       )
   }
}

This will throw:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot read field "x" because "rc" is null
	at java.desktop/sun.awt.windows.WInputMethod$1.run(WInputMethod.java:617)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:747)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:744)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
@Omico Omico added bug Something isn't working submitted labels Jul 2, 2024
@igordmn
Copy link
Collaborator

igordmn commented Jul 4, 2024

Thanks!

Reproduced in 1.7.0-dev1703 with Chinese input.

Not reproduced in 1.6.10 or with English input.

It seems only the popup position is affected. Crash only appears in the console, it doesn't crash the app.

@igordmn igordmn added p:critical Critical priority regression input Touch, mouse, keyboard input related and removed submitted labels Jul 4, 2024
@igordmn igordmn self-assigned this Jul 4, 2024
@igordmn
Copy link
Collaborator

igordmn commented Jul 4, 2024

The same crash was fixed before in JetBrains/compose-multiplatform-core#339. It might doesn't work after big TextField rewriting in 1.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working input Touch, mouse, keyboard input related p:critical Critical priority regression reproduced
Projects
None yet
Development

No branches or pull requests

2 participants