diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/slice2cs/Gen.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index 1b74ff5b634..2fca1a449b1 100644 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -5429,7 +5429,9 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out.inc(); _out << nl << "(" << delType << " cb__, " << (returnTypeS.empty() ? "object" : returnTypeS) << " ret__) =>"; _out << sb; - _out << nl << "cb__?.Invoke" << spar; + _out << nl << "if(cb__ != null)"; + _out << sb; + _out << nl << "cb__.Invoke" << spar; if(ret && outParams.empty()) { _out << "ret__"; @@ -5450,6 +5452,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << "ret__"; } _out << epar << ';'; + _out << eb; _out << eb << ","; _out << nl << "this, " << flatName << ", cookie__, completedCallback__);"; |