Skip to content

Commit b432dcd

Browse files
committed
More validation checks while creating new settings assets
1 parent 795c87e commit b432dcd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Assets/Editor Toolbox/Editor/Management/ToolboxManager.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,12 @@ void ReintializeProvider()
213213

214214
if (GUILayout.Button("Create a new settings file"))
215215
{
216-
var settingsInstance = ScriptableObject.CreateInstance(settingsType);
216+
var settingsInstance = ScriptableObject.CreateInstance<ToolboxEditorSettings>();
217+
if (settingsInstance == null)
218+
{
219+
ToolboxEditorLog.LogError($"Something went wrong. Cannot create a new Settings file.");
220+
return;
221+
}
217222

218223
var locationPath = EditorUtility.OpenFolderPanel("New Settings file location", "Assets", "");
219224
//validate returned path and create relative one if possible

0 commit comments

Comments
 (0)