Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit c55e317

Browse files
gesslarthefallentree
authored andcommitted
added protection if the data isn't what is expected
1 parent 68a79b3 commit c55e317

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/cmds/player/chanlist.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ private nomask string fmt_imud_channel(string channel_name,
2626
mixed * channel_data)
2727
{
2828
string owner = channel_data[0];
29-
string type = ({ "unrestricted",
30-
"restricted",
31-
"filtered" })[channel_data[1]];
29+
string type ;
30+
string *valid_types = ({ "unrestricted", "restricted", "filtered" }) ;
3231

32+
if(!intp(channel_data[1])) type = save_variable(channel_data[1]) ;
33+
else type = valid_types[channel_data[1]];
3334
if ( owner == "*" )
3435
owner = "no owner";
3536

0 commit comments

Comments
 (0)