File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,6 +49,13 @@ private void OnDisable()
4949
5050 private void OnGUI ( )
5151 {
52+ if ( targetType == null )
53+ {
54+ onCreationCallback ? . Invoke ( false ) ;
55+ Close ( ) ;
56+ return ;
57+ }
58+
5259 using ( new EditorGUILayout . VerticalScope ( "Box" ) )
5360 {
5461 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