Skip to content

Commit

Permalink
Merge pull request #3 from red-001/fix_crash
Browse files Browse the repository at this point in the history
Stop `/rank` from crashing the server when passed an empty string.
  • Loading branch information
bigfoot547 committed Jun 1, 2017
2 parents 54104c8 + 89ed986 commit bc762ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ minetest.register_chatcommand("rank", {
func = function(name, param)
local target = param:split(' ')[1]
local param = param:split(' ')[2]
if not param then return false, "Invalid Usage. See /help rank." end
param = param:lower()
if not param then return false, "Invalid Usage." end
if param == "wood" or param == "stone" or param == "coal" or param == "iron" or param == "copper" or param == "gold" or param == "mese"
or param == "diamond" or param == "obsidian" or param == "air" or param == "void" or param == "admin" or param == "moderator" or param == "bronze" then
if minetest.get_player_by_name(target) then
Expand Down

0 comments on commit bc762ed

Please sign in to comment.