Skip to content

Commit

Permalink
fix: Fixes NPE when using http request.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Aug 15, 2023
1 parent 1d2b7f1 commit 5acd99d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import jakarta.ws.rs.Produces
import jakarta.ws.rs.core.MediaType
import jakarta.ws.rs.core.Response
import org.jitsi.jicofo.xmpp.ConferenceIqHandler
import org.jitsi.utils.logging2.createLogger
import org.jitsi.xmpp.extensions.jitsimeet.ConferenceIq
import org.jivesoftware.smack.packet.ErrorIQ
import org.jivesoftware.smack.packet.IQ
Expand All @@ -38,6 +39,8 @@ import org.jxmpp.stringprep.XmppStringprepException
class ConferenceRequest(
val conferenceIqHandler: ConferenceIqHandler
) {
private val logger = createLogger()

@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
Expand All @@ -48,6 +51,7 @@ class ConferenceRequest(
} catch (e: XmppStringprepException) {
throw BadRequestExceptionWithMessage("Invalid room name: ${e.message}")
} catch (e: Exception) {
logger.error(e.message, e)
throw BadRequestExceptionWithMessage(e.message)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class ConferenceIqHandler(
val visitorSupported = query.properties.any { it.name == "visitors-version" }
val visitorRequested = query.properties.any { it.name == "visitor" && it.value == "true" }
val vnode = if (visitorSupported && visitorsManager.enabled &&
!XmppConfig.config.trustedDomains.contains(query.from.asDomainBareJid())
(query.from == null || !XmppConfig.config.trustedDomains.contains(query.from.asDomainBareJid()))
) {
conference?.redirectVisitor(visitorRequested)
} else {
Expand Down

0 comments on commit 5acd99d

Please sign in to comment.