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

A crash while saving NBT #8

Open
MorningMC opened this issue Jun 8, 2024 · 0 comments
Open

A crash while saving NBT #8

MorningMC opened this issue Jun 8, 2024 · 0 comments

Comments

@MorningMC
Copy link

CompoundTag config = new CompoundTag();
		
		config.put("globalSettings", GlobalSettings.loader.save(GlobalSettings.instance));
		config.put("profileCollection", ProfileCollection.loader.save(ProfileCollection.instance));
		config.put("javaRuntimeCollection", JavaRuntimeCollection.loader.save(JavaRuntimeCollection.instance));
		config.put("launcher", Launcher.loader.save(launcher));
		config.put("translation", Translation.loader.save(Translation.instance));
		
		try {
			new Nbt().toFile(config, FileMetadata.config); // Crashed here
		} catch (Exception e) {
			logger.error("Failed to save config: ", e);
		}

Stacktrace:

java.lang.NullPointerException: Cannot read field "next" because "this.next" is null
	at java.util.LinkedList$ListItr.next(LinkedList.java:904) ~[?:?]
	at dev.dewy.nbt.tags.collection.ListTag.write(ListTag.java:109) ~[nbt-1.5.1.jar:?]
	at dev.dewy.nbt.tags.collection.CompoundTag.write(CompoundTag.java:92) ~[nbt-1.5.1.jar:?]
	at dev.dewy.nbt.io.NbtWriter.toStream(NbtWriter.java:37) ~[nbt-1.5.1.jar:?]
	at dev.dewy.nbt.Nbt.toStream(Nbt.java:85) ~[nbt-1.5.1.jar:?]
	at dev.dewy.nbt.Nbt.toFile(Nbt.java:122) ~[nbt-1.5.1.jar:?]
	at dev.dewy.nbt.Nbt.toFile(Nbt.java:96) ~[nbt-1.5.1.jar:?]
	at minecraft.morningmc.mcli.launcher.main.Main.stop(Main.java:132) ~[classes/:?]
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$10(LauncherImpl.java:858) ~[javafx-graphics-21-win.jar:?]
	at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483) ~[javafx-graphics-21-win.jar:?]
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456) ~[javafx-graphics-21-win.jar:?]
	at java.security.AccessController.doPrivileged(AccessController.java:400) ~[?:?]
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455) ~[javafx-graphics-21-win.jar:?]
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) ~[javafx-graphics-21-win.jar:?]
	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) ~[javafx-graphics-21-win.jar:?]
	at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:185) ~[javafx-graphics-21-win.jar:?]
	at java.lang.Thread.run(Thread.java:1583) ~[?:?]
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

No branches or pull requests

1 participant