Skip to content

Commit

Permalink
Fix problems if peer doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
JANKROL123 committed Mar 30, 2024
1 parent ecb7848 commit 94eda93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/pages/RoomCallPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function RoomCallPage() {
const params = useParams();
const navigate = useNavigate();
const roomId = params.roomId;
peer.on("call", async (call) => {
peer?.on("call", async (call) => {
if (localStream) {
call.answer(localStream);
} else {
Expand Down Expand Up @@ -145,7 +145,7 @@ function RoomCallPage() {
return (
<>
<Navbar />
{localStream ? (
{localStream && peer ? (
<main>
<div className="flex justify-center p-2">
<button className="btn p-6" onClick={() => startStopAudio()}>
Expand Down

0 comments on commit 94eda93

Please sign in to comment.