Skip to content

Commit

Permalink
Fix a KeyError
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerlong committed Apr 3, 2024
1 parent d75234f commit 9aa3d7b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion ringcentral/demos/demo_subscription.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from ringcentral import SDK
from dotenv import load_dotenv
import asyncio
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))) # Add the project root to sys.path
from ringcentral.websocket.events import WebSocketEvents
from ringcentral import SDK

def on_notification(message):
print("\n Subscription notification:\n")
Expand Down
2 changes: 1 addition & 1 deletion ringcentral/websocket/web_socket_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, web_socket_client):

def on_message(self, message):
message_json = json.loads(message)
if(message_json[0]['type'] == 'ClientRequest' and message_json[0]['headers']['WSG-SubscriptionId']):
if(message_json[0]['type'] == 'ClientRequest' and 'WSG-SubscriptionId' in message_json[0]['headers']):
self.set_subscription(message_json)
self._web_socket_client.trigger(WebSocketEvents.subscriptionCreated, self)
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

VERSION = '0.8.4'
VERSION = '0.8.5'

setup(
name='ringcentral',
Expand Down

0 comments on commit 9aa3d7b

Please sign in to comment.