@@ -1817,7 +1817,7 @@ function onMessageArrived(message) {
1817
1817
"onConnected" :{
1818
1818
get : function ( ) { return client . onConnected ; } ,
1819
1819
set : function ( newOnConnected ) {
1820
- if ( typeof newOnConnected === "function" )
1820
+ if ( newOnConnected === null || typeof newOnConnected === "function" )
1821
1821
client . onConnected = newOnConnected ;
1822
1822
else
1823
1823
throw new Error ( format ( ERROR . INVALID_TYPE , [ typeof newOnConnected , "onConnected" ] ) ) ;
@@ -1838,7 +1838,7 @@ function onMessageArrived(message) {
1838
1838
"onConnectionLost" :{
1839
1839
get : function ( ) { return client . onConnectionLost ; } ,
1840
1840
set : function ( newOnConnectionLost ) {
1841
- if ( typeof newOnConnectionLost === "function" )
1841
+ if ( newOnConnectionLost === null || typeof newOnConnectionLost === "function" )
1842
1842
client . onConnectionLost = newOnConnectionLost ;
1843
1843
else
1844
1844
throw new Error ( format ( ERROR . INVALID_TYPE , [ typeof newOnConnectionLost , "onConnectionLost" ] ) ) ;
@@ -1847,7 +1847,7 @@ function onMessageArrived(message) {
1847
1847
"onMessageDelivered" :{
1848
1848
get : function ( ) { return client . onMessageDelivered ; } ,
1849
1849
set : function ( newOnMessageDelivered ) {
1850
- if ( typeof newOnMessageDelivered === "function" )
1850
+ if ( newOnMessageDelivered === null || typeof newOnMessageDelivered === "function" )
1851
1851
client . onMessageDelivered = newOnMessageDelivered ;
1852
1852
else
1853
1853
throw new Error ( format ( ERROR . INVALID_TYPE , [ typeof newOnMessageDelivered , "onMessageDelivered" ] ) ) ;
@@ -1856,7 +1856,7 @@ function onMessageArrived(message) {
1856
1856
"onMessageArrived" :{
1857
1857
get : function ( ) { return client . onMessageArrived ; } ,
1858
1858
set : function ( newOnMessageArrived ) {
1859
- if ( typeof newOnMessageArrived === "function" )
1859
+ if ( newOnMessageArrived === null || typeof newOnMessageArrived === "function" )
1860
1860
client . onMessageArrived = newOnMessageArrived ;
1861
1861
else
1862
1862
throw new Error ( format ( ERROR . INVALID_TYPE , [ typeof newOnMessageArrived , "onMessageArrived" ] ) ) ;
@@ -1865,7 +1865,7 @@ function onMessageArrived(message) {
1865
1865
"trace" :{
1866
1866
get : function ( ) { return client . traceFunction ; } ,
1867
1867
set : function ( trace ) {
1868
- if ( typeof trace === "function" ) {
1868
+ if ( trace === null || typeof trace === "function" ) {
1869
1869
client . traceFunction = trace ;
1870
1870
} else {
1871
1871
throw new Error ( format ( ERROR . INVALID_TYPE , [ typeof trace , "onTrace" ] ) ) ;
0 commit comments