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

Inspector should print [couldn't preload] and not 'null' if it fails to display variable. #99655

Open
RafalLauterbach opened this issue Nov 24, 2024 · 0 comments

Comments

@RafalLauterbach
Copy link

RafalLauterbach commented Nov 24, 2024

Tested versions

Godot Version

v4.3.stable.official [77dcf97]

System information

Arch Linux

Issue description

Today I've stumbled upon problem with inspector. I wanted to check if my dictionary of 10 arrays of 16'000 elements (~11MB json file) loaded correctly - aand (in the end it turns out) loading data works fine, but when setting up breakpoint and checking if it worked I got < null > value. But it isn't really null - it's just that inspector can't show it! < null > is uninitialized value or deleted value. This inspector should really show something other than null... because the value is not < null >, it just ran out of buffer space(?) while trying to display it.

After spending like half hour trying to find out why is my file is not loading - I figured out that it actually is loading correctly and I just wasted time looking for problem that never was here. It really should print something else than < null >.

Also the same 11MB file in text format also shows up as < null > instead of [couldn't inspect] or something... Or it could just inspect first x characters..

Other than that - it's great that inspector is robust enough to not crash whole project. It is just missleading.

Steps to reproduce

create >11MB json file.
open it and save into variables
they should be < null > , unless you have modified inspector settings, I guess.. Then it might require bigger file.

Minimal reproduction project (MRP)

var file : FileAccess;
const FILENAME = "user://test/interesting_symbol_db";
func _ready():
	if (not DirAccess.dir_exists_absolute("user://test")):
		DirAccess.make_dir_recursive_absolute("user://test");
	#make big file, somehow.
	file = FileAccess.open(FILENAME,FileAccess.READ);
	var text = file.get_as_text();
	var json = JSON.parse_string(file.get_as_text());
	file.close();
	if (json==null):
		print("json load failed") #it shouldn't trigger, even though  inspector shows json=< null >
		json = {};
	breakpoint;
	return;

#if file is >~11MB size both text and json should show < null > in inspector. It would be better if showed something less missleading.

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