diff --git a/CHANGELOG.md b/CHANGELOG.md index 14e927d..aee0cfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ Note to self: See the bottom of this file for the release template text. - `moretrees:apple_tree_sapling_ongen` from `apple` to `apple_moretrees` - Add `plum` → `plumtree:sapling` - Add `holly` ⇒ `hollytree:sapling` + - `//replacemix`: Improve error handling to avoid crashes (thanks, Jonathon for reporting via Discord!) ## v1.12: The selection tools update (26th June 2021) diff --git a/worldeditadditions_commands/commands/replacemix.lua b/worldeditadditions_commands/commands/replacemix.lua index 085e596..dd5ff77 100644 --- a/worldeditadditions_commands/commands/replacemix.lua +++ b/worldeditadditions_commands/commands/replacemix.lua @@ -53,6 +53,9 @@ worldedit.register_command("replacemix", { end end end + if not target_node then return false, "Error: No target node specified." end + if not last_node_name then return false, "Error: At least 1 replace node must be specified." end + if not replace_nodes[last_node_name] then replace_nodes[last_node_name] = 1 end