mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 01:06:01 +08:00
Avoid nullrefs on clearing graph
This commit is contained in:
parent
7863679da6
commit
dd62011cfb
@ -47,7 +47,7 @@ namespace XNode {
|
|||||||
public virtual void Clear() {
|
public virtual void Clear() {
|
||||||
if (Application.isPlaying) {
|
if (Application.isPlaying) {
|
||||||
for (int i = 0; i < nodes.Count; i++) {
|
for (int i = 0; i < nodes.Count; i++) {
|
||||||
Destroy(nodes[i]);
|
if (nodes[i] != null) Destroy(nodes[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nodes.Clear();
|
nodes.Clear();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user