@@ -104,7 +104,7 @@ public object Call(params object[] args)
104104 {
105105 var res = context . FireEventByRefCallback ? . Call ( i , args ) ;
106106#if REACT_QUICKJS
107- ( context . Script . Engine as Scripting . QuickJSEngine ) ? . Runtime . ExecutePendingJob ( ) ;
107+ ( context . Script . Engine as Scripting . QuickJSEngine ) ? . Runtime ? . ExecutePendingJob ( ) ;
108108#endif
109109 return res ;
110110 }
@@ -114,33 +114,33 @@ public object Call(params object[] args)
114114 // TODO: because of an error in ClearScipt, arrays cannot be iterated (Mono bug?)
115115 so . Engine . Global . SetProperty ( "__temp__" , so ) ;
116116 so . Engine . Global . SetProperty ( "__args__" , args ? . ToList ( ) ) ;
117- var res = so . Engine . Evaluate ( null , true , "var res = __temp__(...(__args__ || [])); delete __temp__; delete __args__; res;" ) ;
117+ var res = so . Engine ? . Evaluate ( null , true , "var res = __temp__(...(__args__ || [])); delete __temp__; delete __args__; res;" ) ;
118118 return res ;
119119 }
120120#endif
121121#if REACT_QUICKJS
122122 else if ( callback is QuickJS. ScriptFunction sf)
123123 {
124124 var res = sf . Invoke < object > ( args ) ;
125- QuickJS . ScriptEngine . GetRuntime ( sf . ctx ) . ExecutePendingJob ( ) ;
125+ QuickJS . ScriptEngine . GetRuntime ( sf . ctx ) ? . ExecutePendingJob ( ) ;
126126 return res ;
127127 }
128128 else if ( callback is QuickJS. ScriptValue sv)
129129 {
130130 var sff = new QuickJS . ScriptFunction ( QuickJS . ScriptEngine . GetContext ( sv . ctx ) , sv ) ;
131131 var res = sff . Invoke < object > ( args ) ;
132132 sff . Dispose ( ) ;
133- QuickJS . ScriptEngine . GetRuntime ( sv . ctx ) . ExecutePendingJob ( ) ;
133+ QuickJS . ScriptEngine . GetRuntime ( sv . ctx ) ? . ExecutePendingJob ( ) ;
134134 return res ;
135135 }
136136 else if ( callback is QuickJS. Native. JSValue qf)
137137 {
138- var eg = ( context ? . Script . Engine as Scripting . QuickJSEngine ) ;
138+ var eg = ( context ? . Script ? . Engine as Scripting . QuickJSEngine ) ;
139139 if ( eg == null ) return null ;
140140 var sff = new QuickJS . ScriptFunction ( eg . MainContext , qf ) ;
141141 var res = sff . Invoke < object > ( args ) ;
142142 sff . Dispose ( ) ;
143- eg ? . Runtime . ExecutePendingJob ( ) ;
143+ eg ? . Runtime ? . ExecutePendingJob ( ) ;
144144 return res ;
145145 }
146146#endif
0 commit comments