Fix deleting neuron without synapses
This commit is contained in:
parent
fc8caa8a29
commit
335dae788b
@ -266,6 +266,9 @@ namespace NanoBrain {
|
||||
}
|
||||
|
||||
public static void Delete(Nucleus nucleus) {
|
||||
if (nucleus == null)
|
||||
return;
|
||||
if (nucleus.synapses != null) {
|
||||
foreach (Synapse synapse in nucleus.synapses) {
|
||||
if (synapse.neuron is Neuron synapse_nucleus) {
|
||||
if (synapse_nucleus.receivers.Count > 1) {
|
||||
@ -278,6 +281,7 @@ namespace NanoBrain {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nucleus is Neuron neuron) {
|
||||
foreach (Nucleus receiver in neuron.receivers) {
|
||||
if (receiver != null && receiver.synapses != null)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user