Skip to content

Commit 12b25e1

Browse files
bug on add model
1 parent 849a6a3 commit 12b25e1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

luasrc/actions/models/add_model.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ private_vibescript.add_model = function(config_json)
2525
for i = 1, #config_json.models do
2626
if config_json.models[i].name == model_name then
2727
alreay_exists = true
28-
config_json.models[#config_json.models + 1] = model
29-
3028
end
3129
end
3230

33-
3431
if not alreay_exists then
3532
config_json.models[#config_json.models + 1] = model
3633
end
34+
if alreay_exists then
35+
error("Model with name " .. model_name .. " already exists", 0)
36+
end
3737

3838
private_vibescript.save_config_json(config_json)
3939
end

0 commit comments

Comments
 (0)