We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a28afb9 commit fcb6b96Copy full SHA for fcb6b96
Scripts/env.cs
@@ -66,10 +66,19 @@ public static Dictionary<string, string> ParseEnvironmentFile()
66
{
67
68
#if UNITY_EDITOR
69
- return ParseEnvironmentFile(File.ReadAllText(editorFilePath, Encoding.UTF8));
+ if (File.Exists(editorFilePath))
70
+ {
71
+ return ParseEnvironmentFile(File.ReadAllText(editorFilePath, Encoding.UTF8));
72
+ }
73
#else
- return ParseEnvironmentFile(((TextAsset)Resources.Load(filename)).text);
74
+ var contents = Resources.Load<TextAsset>(filename);
75
+
76
+ if (contents)
77
78
+ return ParseEnvironmentFile(contents.text);
79
80
#endif
81
+ return new Dictionary<string, string>();
82
83
}
84
0 commit comments