Просмотр исходного кода

fix: Adds nil check in some util methods.

factor2
damencho 4 месяцев назад
Родитель
Сommit
532b5858c5
1 измененных файлов: 9 добавлений и 1 удалений
  1. 9
    1
      resources/prosody-plugins/util.lib.lua

+ 9
- 1
resources/prosody-plugins/util.lib.lua Просмотреть файл

@@ -474,12 +474,20 @@ end
474 474
 
475 475
 -- Returns the initiator extension if the stanza is coming from a sip jigasi
476 476
 function is_sip_jigasi(stanza)
477
+    if not stanza then
478
+        return false;
479
+    end
480
+
477 481
     return stanza:get_child('initiator', 'http://jitsi.org/protocol/jigasi');
478 482
 end
479 483
 
480 484
 function is_transcriber_jigasi(stanza)
485
+    if not stanza then
486
+        return false;
487
+    end
488
+
481 489
     local features = stanza:get_child('features');
482
-    if not features  then
490
+    if not features then
483 491
         return false;
484 492
     end
485 493
 

Загрузка…
Отмена
Сохранить