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

how to check the data on the func _on_game_load_success(data): function is null #28

Closed
titangamingglt opened this issue Jun 28, 2020 · 1 comment

Comments

@titangamingglt
Copy link

suppose i dont have any previous file saved and then try to load the file first without saving it first it is just corruption my game file. i have tried to use data!= null but that doesnot work!

@cgisca
Copy link
Owner

cgisca commented Jul 24, 2020

Hi @titangamingglt , to prevent the case you are encountering you could try following (in the success callback of the load game):

func _on_game_load_success(data: String) -> void:
	if data:
		var game_data: Dictionary = parse_json(data)
		print("Do something with the %s"%data)

@cgisca cgisca closed this as completed Aug 29, 2020
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

2 participants