@@ -1809,7 +1809,7 @@ function onMessageArrived(message) {
1809
1809
"onConnected" :{
1810
1810
get : function ( ) { return client . onConnected ; } ,
1811
1811
set : function ( newOnConnected ) {
1812
- if ( typeof newOnConnected === "function" )
1812
+ if ( newOnConnected === null || typeof newOnConnected === "function" )
1813
1813
client . onConnected = newOnConnected ;
1814
1814
else
1815
1815
throw new Error ( format ( ERROR . INVALID_TYPE , [ typeof newOnConnected , "onConnected" ] ) ) ;
@@ -1830,7 +1830,7 @@ function onMessageArrived(message) {
1830
1830
"onConnectionLost" :{
1831
1831
get : function ( ) { return client . onConnectionLost ; } ,
1832
1832
set : function ( newOnConnectionLost ) {
1833
- if ( typeof newOnConnectionLost === "function" )
1833
+ if ( newOnConnectionLost === null || typeof newOnConnectionLost === "function" )
1834
1834
client . onConnectionLost = newOnConnectionLost ;
1835
1835
else
1836
1836
throw new Error ( format ( ERROR . INVALID_TYPE , [ typeof newOnConnectionLost , "onConnectionLost" ] ) ) ;
@@ -1839,7 +1839,7 @@ function onMessageArrived(message) {
1839
1839
"onMessageDelivered" :{
1840
1840
get : function ( ) { return client . onMessageDelivered ; } ,
1841
1841
set : function ( newOnMessageDelivered ) {
1842
- if ( typeof newOnMessageDelivered === "function" )
1842
+ if ( newOnMessageDelivered === null || typeof newOnMessageDelivered === "function" )
1843
1843
client . onMessageDelivered = newOnMessageDelivered ;
1844
1844
else
1845
1845
throw new Error ( format ( ERROR . INVALID_TYPE , [ typeof newOnMessageDelivered , "onMessageDelivered" ] ) ) ;
@@ -1848,7 +1848,7 @@ function onMessageArrived(message) {
1848
1848
"onMessageArrived" :{
1849
1849
get : function ( ) { return client . onMessageArrived ; } ,
1850
1850
set : function ( newOnMessageArrived ) {
1851
- if ( typeof newOnMessageArrived === "function" )
1851
+ if ( newOnMessageArrived === null || typeof newOnMessageArrived === "function" )
1852
1852
client . onMessageArrived = newOnMessageArrived ;
1853
1853
else
1854
1854
throw new Error ( format ( ERROR . INVALID_TYPE , [ typeof newOnMessageArrived , "onMessageArrived" ] ) ) ;
@@ -1857,7 +1857,7 @@ function onMessageArrived(message) {
1857
1857
"trace" :{
1858
1858
get : function ( ) { return client . traceFunction ; } ,
1859
1859
set : function ( trace ) {
1860
- if ( typeof trace === "function" ) {
1860
+ if ( trace === null || typeof trace === "function" ) {
1861
1861
client . traceFunction = trace ;
1862
1862
} else {
1863
1863
throw new Error ( format ( ERROR . INVALID_TYPE , [ typeof trace , "onTrace" ] ) ) ;
0 commit comments