@@ -104,7 +104,7 @@ public object Call(params object[] args)
104
104
{
105
105
var res = context . FireEventByRefCallback ? . Call ( i , args ) ;
106
106
#if REACT_QUICKJS
107
- ( context . Script . Engine as Scripting . QuickJSEngine ) ? . Runtime . ExecutePendingJob ( ) ;
107
+ ( context . Script . Engine as Scripting . QuickJSEngine ) ? . Runtime ? . ExecutePendingJob ( ) ;
108
108
#endif
109
109
return res ;
110
110
}
@@ -114,33 +114,33 @@ public object Call(params object[] args)
114
114
// TODO: because of an error in ClearScipt, arrays cannot be iterated (Mono bug?)
115
115
so . Engine . Global . SetProperty ( "__temp__" , so ) ;
116
116
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;" ) ;
118
118
return res ;
119
119
}
120
120
#endif
121
121
#if REACT_QUICKJS
122
122
else if ( callback is QuickJS. ScriptFunction sf)
123
123
{
124
124
var res = sf . Invoke < object > ( args ) ;
125
- QuickJS . ScriptEngine . GetRuntime ( sf . ctx ) . ExecutePendingJob ( ) ;
125
+ QuickJS . ScriptEngine . GetRuntime ( sf . ctx ) ? . ExecutePendingJob ( ) ;
126
126
return res ;
127
127
}
128
128
else if ( callback is QuickJS. ScriptValue sv)
129
129
{
130
130
var sff = new QuickJS . ScriptFunction ( QuickJS . ScriptEngine . GetContext ( sv . ctx ) , sv ) ;
131
131
var res = sff . Invoke < object > ( args ) ;
132
132
sff . Dispose ( ) ;
133
- QuickJS . ScriptEngine . GetRuntime ( sv . ctx ) . ExecutePendingJob ( ) ;
133
+ QuickJS . ScriptEngine . GetRuntime ( sv . ctx ) ? . ExecutePendingJob ( ) ;
134
134
return res ;
135
135
}
136
136
else if ( callback is QuickJS. Native. JSValue qf)
137
137
{
138
- var eg = ( context ? . Script . Engine as Scripting . QuickJSEngine ) ;
138
+ var eg = ( context ? . Script ? . Engine as Scripting . QuickJSEngine ) ;
139
139
if ( eg == null ) return null ;
140
140
var sff = new QuickJS . ScriptFunction ( eg . MainContext , qf ) ;
141
141
var res = sff . Invoke < object > ( args ) ;
142
142
sff . Dispose ( ) ;
143
- eg ? . Runtime . ExecutePendingJob ( ) ;
143
+ eg ? . Runtime ? . ExecutePendingJob ( ) ;
144
144
return res ;
145
145
}
146
146
#endif
0 commit comments