File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,6 +48,13 @@ private void OnDisable()
4848
4949 private void OnGUI ( )
5050 {
51+ if ( targetType == null )
52+ {
53+ onCreationCallback ? . Invoke ( false ) ;
54+ Close ( ) ;
55+ return ;
56+ }
57+
5158 using ( new EditorGUILayout . VerticalScope ( "Box" ) )
5259 {
5360 using ( new EditorGUILayout . VerticalScope ( "Box" ) )
Original file line number Diff line number Diff line change @@ -259,17 +259,19 @@ public static void AfterStaticAssemblyReload()
259259
260260 isWaitingForNewTypeBeCreated = false ;
261261
262- if ( string . IsNullOrEmpty ( CreateNewCollectableType . LastGeneratedCollectionScriptPath ) )
263- return ;
264-
265- string assemblyName = CompilationPipeline . GetAssemblyNameFromScriptPath ( CreateNewCollectableType
266- . LastGeneratedCollectionScriptPath ) ;
267-
268- Type targetType = Type . GetType ( $ "{ CreateNewCollectableType . LastCollectionFullName } , { assemblyName } ") ;
262+ string lastGeneratedCollectionScriptPath = CreateNewCollectableType . LastGeneratedCollectionScriptPath ;
263+ string lastCollectionFullName = CreateNewCollectableType . LastCollectionFullName ;
269264
265+ if ( string . IsNullOrEmpty ( lastGeneratedCollectionScriptPath ) )
266+ return ;
267+
270268 CreateNewCollectableType . LastCollectionFullName = string . Empty ;
271269 CreateNewCollectableType . LastGeneratedCollectionScriptPath = string . Empty ;
272270
271+ string assemblyName = CompilationPipeline . GetAssemblyNameFromScriptPath ( lastGeneratedCollectionScriptPath ) ;
272+
273+ Type targetType = Type . GetType ( $ "{ lastCollectionFullName } , { assemblyName } ") ;
274+
273275 if ( CollectionsRegistry . Instance . TryGetCollectionForType ( targetType ,
274276 out ScriptableObjectCollection collection ) )
275277 {
You can’t perform that action at this time.
0 commit comments