fixed fileaccess error
This commit is contained in:
@@ -226,6 +226,10 @@ void DiscordUtil::delete_tokens()
|
|||||||
ConfigFile DiscordUtil::get_tokens(String encryption_key)
|
ConfigFile DiscordUtil::get_tokens(String encryption_key)
|
||||||
{
|
{
|
||||||
ConfigFile config;
|
ConfigFile config;
|
||||||
|
if (!FileAccess::file_exists("user://discord_data.binary"))
|
||||||
|
{
|
||||||
|
return ConfigFile();
|
||||||
|
}
|
||||||
Error err = config.load_encrypted_pass("user://discord_data.binary", encryption_key);
|
Error err = config.load_encrypted_pass("user://discord_data.binary", encryption_key);
|
||||||
if (err != OK)
|
if (err != OK)
|
||||||
{
|
{
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
#include <godot_cpp/core/class_db.hpp>
|
#include <godot_cpp/core/class_db.hpp>
|
||||||
#include <godot_cpp/variant/utility_functions.hpp>
|
#include <godot_cpp/variant/utility_functions.hpp>
|
||||||
#include <godot_cpp/classes/config_file.hpp>
|
#include <godot_cpp/classes/config_file.hpp>
|
||||||
|
#include <godot_cpp/classes/file_access.hpp>
|
||||||
|
|
||||||
using namespace godot;
|
using namespace godot;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user