File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -374,6 +374,7 @@ async def greet_handler(data: RpcInvocationData) -> str:
374374 room = self .room
375375 if room is not None :
376376 return room .register_rpc_method (method_name , handler )
377+ return None
377378
378379 def unregister_rpc_method (self , method : str ) -> None :
379380 """
Original file line number Diff line number Diff line change @@ -497,6 +497,8 @@ async def greet_handler(data: RpcInvocationData) -> str:
497497 """
498498
499499 def register (handler_func ):
500+ if self ._ffi_handle is None :
501+ raise Exception ("cannot register RPC method before room is connected" )
500502 self ._rpc_handlers [method_name ] = handler_func
501503 req = proto_ffi .FfiRequest ()
502504 req .register_rpc_method .room_handle = self ._ffi_handle .handle
@@ -517,6 +519,9 @@ def unregister_rpc_method(self, method: str) -> None:
517519 Args:
518520 method (str): The name of the RPC method to unregister
519521 """
522+ if self ._ffi_handle is None :
523+ raise Exception ("cannot unregister RPC method before room is connected" )
524+
520525 self ._rpc_handlers .pop (method , None )
521526
522527 req = proto_ffi .FfiRequest ()
You can’t perform that action at this time.
0 commit comments