Skip to content

Commit 9611415

Browse files
Merge pull request #441 from skleeschulte/patch-1
In rooms.fn: Prüfen, ob Objekt vom Typ CHANNEL ist
2 parents 50eddf0 + a044dca commit 9611415

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

regascripts/rooms.fn

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
object oRoom;
99
string sRoomId;
1010
string sChannelId;
11+
object oChannel;
1112
boolean bFirst = true;
1213
boolean bFirstSecond = true;
1314

@@ -29,14 +30,18 @@ foreach (sRoomId, dom.GetObject(ID_ROOMS).EnumUsedIDs())
2930
Write('", "Channels":[');
3031
bFirstSecond = true;
3132
foreach(sChannelId, oRoom.EnumIDs()) {
33+
oChannel = dom.GetObject(sChannelId);
34+
! Objekt ueberspringen, falls nicht vom Typ CHANNEL (33)
35+
if (oChannel.Type() != 33) { continue; }
36+
3237
if (bFirstSecond == false) {
3338
Write(',');
3439
} else {
3540
bFirstSecond = false;
3641
}
37-
string sIfaceId = dom.GetObject(sChannelId).Interface();
42+
string sIfaceId = oChannel.Interface();
3843
string sIface = dom.GetObject(sIfaceId).Name();
39-
Write('{"Address":"' # dom.GetObject(sChannelId).Address() # '",');
44+
Write('{"Address":"' # oChannel.Address() # '",');
4045
Write('"Interface":"' # sIface # '"}');
4146

4247
}

0 commit comments

Comments
 (0)