fix(ui): fix crash when controlnet enabled but no controlnets added

This commit is contained in:
psychedelicious 2023-06-12 10:09:41 +10:00
parent e051c450ed
commit 8607b1994c

View File

@ -12,8 +12,10 @@ export const addControlNetToLinearGraph = (
): void => { ): void => {
const { isEnabled: isControlNetEnabled, controlNets } = state.controlNet; const { isEnabled: isControlNetEnabled, controlNets } = state.controlNet;
const controlNetCount = size(controlNets);
// Add ControlNet // Add ControlNet
if (isControlNetEnabled) { if (isControlNetEnabled && controlNetCount > 0) {
if (size(controlNets) > 1) { if (size(controlNets) > 1) {
const controlNetIterateNode: CollectInvocation = { const controlNetIterateNode: CollectInvocation = {
id: CONTROL_NET_COLLECT, id: CONTROL_NET_COLLECT,