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

Null pointer exception #12922

Open
1 task done
metablaster opened this issue Feb 7, 2025 · 4 comments
Open
1 task done

Null pointer exception #12922

metablaster opened this issue Feb 7, 2025 · 4 comments
Labels

Comments

@metablaster
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Game Version

4.15.9

Describe the bug

This was reported when the crash occured:

Platform: Desktop
Version: 4.15.9 (Build 1.100)
Rulesets: [Higher quality builtin sounds, Unciv Vanilla Music Pack, Civ V - Vanilla, Community Maps, Civ V Leader portraits, unciv realistic earth maps, Civ6 Tileset, Civ IV Music, Higher Quality City Ambience Sounds, Civ V - Gods & Kings, Civilization II Music, Edges Tileset, 5Hex Tileset, 4X Audio]
Last Screen: com.unciv.ui.screens.worldscreen.WorldScreen


OS: Linux (amd64, 6.12.9+bpo-amd64)
Debian GNU/Linux 12 (bookworm)
Java: Eclipse Adoptium Temurin-21.0.6+7
Max Memory: 8192 MB
System default encoding: UTF-8


Message:

java.lang.NullPointerException: Cannot invoke "com.badlogic.gdx.scenes.scene2d.Actor.stageToLocalCoordinates(com.badlogic.gdx.math.Vector2)" because "this.actor" is null
	at com.badlogic.gdx.scenes.scene2d.utils.ActorGestureListener.handle(ActorGestureListener.java:126)
	at com.badlogic.gdx.scenes.scene2d.Stage.touchUp(Stage.java:354)
	at com.unciv.ui.screens.basescreen.UncivStage.access$touchUp$s80204510(UncivStage.kt:17)
	at com.unciv.ui.screens.basescreen.UncivStage$touchUp$1.invoke(UncivStage.kt:87)
	at com.unciv.ui.screens.basescreen.UncivStage$touchUp$1.invoke(UncivStage.kt:87)
	at com.unciv.ui.crashhandling.CrashHandlingExtensionsKt$wrapCrashHandling$1.invoke(CrashHandlingExtensions.kt:17)
	at com.unciv.ui.screens.basescreen.UncivStage.touchUp(UncivStage.kt:87)
	at com.badlogic.gdx.InputEventQueue.drain(InputEventQueue.java:70)
	at com.badlogic.gdx.backends.lwjgl3.DefaultLwjgl3Input.update(DefaultLwjgl3Input.java:190)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:414)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:181)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:153)
	at com.unciv.app.desktop.HardenGdxAudio.<init>(HardenGdxAudio.kt:54)
	at com.unciv.app.desktop.DesktopLauncher.main(DesktopLauncher.kt:115)

Save Mods:

[Civ V - Gods & Kings]

Permanent audiovisual Mods:

[Civ IV Music, Higher Quality City Ambience Sounds, Additional Music Ambient, Unciv-Audio, 4X Music, Civilization II Music, Civ V Leader portraits, Edges Tileset, Additional Music Various, 4X Audio]

Save Data:

Edited out due to size limitation, see attached zip file instead.

Steps to Reproduce

Not sure but I recall pressing both mouse keys, left followed by right relatively quickly, it was by mistake.

Screenshots

No response

Link to save file

Rim - 620 poteza.zip

Operating System

Linux

Additional Information

No response

@metablaster metablaster added the bug label Feb 7, 2025
@SomeTroglodyte
Copy link
Collaborator

I'm only following this project very loosely these days, bit this sounds curious. The stack trace shows only Gdx code except our Exception handling stuff. So first suspicion - Gdx's fault... But.

ActorGestureListener retrieves a listener Actor reference from some Event - the Event class does not guarantee non-null here but ActorGestureListener dereferences it without a check. So, how can event processing get to a touchUp with an Event object that doesn't know which Actor the Listener that fired it was attached to? There's presumably no check because an unattached Listener won't fire Events...

So, to have any chance to investigate one would need to know more - the save itself won't make a difference, but: Which distro - does it Wayland or not? Unusual screen layout / scaling / something? Most importantly: Where exactly did that dual click happen? Do Screenshot and paint an arrow on it?

@metablaster
Copy link
Contributor Author

I'm using X11 not Wayland, 1920x1080, game in full screen.
Distro Debian 12, see screenshot...

I don't know where exactly and what I clicked but I'm 100% sure it was in lower left corner of the screen, most likely unit panel because it's the only thing in lower left corner. (it was not left and right arrow on the panel used to cycle units because I don't use them)

Image

That's as much as I can say, I'll try repro this again, and if occurs again I'll share more info.

@metablaster
Copy link
Contributor Author

metablaster commented Feb 12, 2025

@SomeTroglodyte

OK, I have the exact repro steps, tested it and able to crash the game each time I do this:

  1. Load attached save file, probably any save file will do as well but the one attached is where I've been testing it
  2. Enter into any city with right mouse click
  3. To exit city don't left click "Exit City" button but instead do this:
  • Click and hold left mouse on "Exit City" button and then right click on it while left click is pressed (in other words use both mouse buttons on "Exit City" button)
  • Game will crash

It doesn't matter whether you first press and hold left button or right button, all that matter is that one button is pressed and held on "Exit City" Button while another button follows in same time.

Here is screenshot as requested:

Image

Save file:

Rim - 839 poteza.zip

@yairm210
Copy link
Owner

Cool, repro steps are 90% of solution

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

No branches or pull requests

3 participants