diff --git a/Scripts/Editor/NodeEditorAssetModProcessor.cs b/Scripts/Editor/NodeEditorAssetModProcessor.cs
index bd76116..edaebaa 100644
--- a/Scripts/Editor/NodeEditorAssetModProcessor.cs
+++ b/Scripts/Editor/NodeEditorAssetModProcessor.cs
@@ -6,7 +6,8 @@ namespace XNodeEditor {
class NodeEditorAssetModProcessor : UnityEditor.AssetModificationProcessor {
/// Automatically delete Node sub-assets before deleting their script.
- /// This is important to do, because you can't delete null sub assets.
+ /// This is important to do, because you can't delete null sub assets.
+ /// For another workaround, see: https://gitlab.com/RotaryHeart-UnityShare/subassetmissingscriptdelete
private static AssetDeleteResult OnWillDeleteAsset (string path, RemoveAssetOptions options) {
// Get the object that is requested for deletion
UnityEngine.Object obj = AssetDatabase.LoadAssetAtPath (path);
@@ -51,6 +52,8 @@ namespace XNodeEditor {
Object[] objs = AssetDatabase.LoadAllAssetRepresentationsAtPath (assetpath);
// Ensure that all sub node assets are present in the graph node list
for (int u = 0; u < objs.Length; u++) {
+ // Ignore null sub assets
+ if (objs[u] == null) continue;
if (!graph.nodes.Contains (objs[u] as XNode.Node)) graph.nodes.Add(objs[u] as XNode.Node);
}
}