diff --git a/src/Autoload/Palettes.gd b/src/Autoload/Palettes.gd index 60ffc2ada..d11755274 100644 --- a/src/Autoload/Palettes.gd +++ b/src/Autoload/Palettes.gd @@ -119,6 +119,8 @@ func _create_new_empty_palette(name: String, comment: String, width: int, height func _create_new_palette_from_current_palette(name: String, comment: String) -> void: + if !current_palette: + return var new_palette: Palette = current_palette.duplicate() new_palette.name = name new_palette.comment = comment diff --git a/src/Palette/CreatePaletteDialog.gd b/src/Palette/CreatePaletteDialog.gd index cdec31764..5225527fd 100644 --- a/src/Palette/CreatePaletteDialog.gd +++ b/src/Palette/CreatePaletteDialog.gd @@ -35,6 +35,9 @@ func open(opened_current_palette: Palette) -> void: # Disable ok button until user enters name toggle_ok_button_disability(true) + # Disable create "From Current Palette" if there's no palette + preset_input.set_item_disabled(1, !current_palette) + # Stop all inputs in the rest of the app Global.dialog_open(true) popup_centered()