mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-27 02:04:09 +00:00
[fix] Add bounds checking for clipspace indices to prevent paste errors (#4849)
Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -385,8 +385,15 @@ export class ComfyApp {
|
||||
static pasteFromClipspace(node: LGraphNode) {
|
||||
if (ComfyApp.clipspace) {
|
||||
// image paste
|
||||
const combinedImgSrc =
|
||||
ComfyApp.clipspace.imgs?.[ComfyApp.clipspace.combinedIndex].src
|
||||
let combinedImgSrc: string | undefined
|
||||
if (
|
||||
ComfyApp.clipspace.combinedIndex !== undefined &&
|
||||
ComfyApp.clipspace.imgs &&
|
||||
ComfyApp.clipspace.combinedIndex < ComfyApp.clipspace.imgs.length
|
||||
) {
|
||||
combinedImgSrc =
|
||||
ComfyApp.clipspace.imgs[ComfyApp.clipspace.combinedIndex].src
|
||||
}
|
||||
if (ComfyApp.clipspace.imgs && node.imgs) {
|
||||
if (node.images && ComfyApp.clipspace.images) {
|
||||
if (ComfyApp.clipspace['img_paste_mode'] == 'selected') {
|
||||
|
||||
Reference in New Issue
Block a user