@@ -104,15 +104,18 @@ def publish_callback(self, publishresult):
104104 while self .subscription_id is None :
105105 time .sleep (0.01 )
106106
107- for notif in publishresult .NotificationMessage .NotificationData :
108- if isinstance (notif , ua .DataChangeNotification ):
109- self ._call_datachange (notif )
110- elif isinstance (notif , ua .EventNotificationList ):
111- self ._call_event (notif )
112- elif isinstance (notif , ua .StatusChangeNotification ):
113- self ._call_status (notif )
114- else :
115- self .logger .warning ("Notification type not supported yet for notification %s" , notif )
107+ if publishresult .NotificationMessage .NotificationData is not None :
108+ for notif in publishresult .NotificationMessage .NotificationData :
109+ if isinstance (notif , ua .DataChangeNotification ):
110+ self ._call_datachange (notif )
111+ elif isinstance (notif , ua .EventNotificationList ):
112+ self ._call_event (notif )
113+ elif isinstance (notif , ua .StatusChangeNotification ):
114+ self ._call_status (notif )
115+ else :
116+ self .logger .warning ("Notification type not supported yet for notification %s" , notif )
117+ else :
118+ self .logger .warning ("NotificationMessage is None." )
116119
117120 ack = ua .SubscriptionAcknowledgement ()
118121 ack .SubscriptionId = self .subscription_id
0 commit comments