mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 15:42:39 +08:00
[native] Fix script errors if Material.getProperty returns null (#13665)
This commit is contained in:
@@ -221,6 +221,8 @@ matProto.getProperty = function (name: string, passIdx?: number) {
|
||||
}
|
||||
|
||||
return arr || val;
|
||||
} else if (val === null || val === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let ret;
|
||||
@@ -266,11 +268,6 @@ materialProto._ctor = function () {
|
||||
this._passes = [];
|
||||
|
||||
this._registerPassesUpdatedListener();
|
||||
// _initializerDefineProperty(_this, "_effectAsset", _descriptor$d, _assertThisInitialized(_this));
|
||||
// _initializerDefineProperty(_this, "_techIdx", _descriptor2$9, _assertThisInitialized(_this));
|
||||
// _initializerDefineProperty(_this, "_defines", _descriptor3$7, _assertThisInitialized(_this));
|
||||
// _initializerDefineProperty(_this, "_states", _descriptor4$6, _assertThisInitialized(_this));
|
||||
// _initializerDefineProperty(_this, "_props", _descriptor5$4, _assertThisInitialized(_this));
|
||||
this._isCtorCalled = true;
|
||||
};
|
||||
|
||||
|
||||
@@ -1075,7 +1075,11 @@ bool nativevalue_to_se(const ccstd::variant<ARGS...> *from, se::Value &to, se::O
|
||||
|
||||
template <typename... ARGS>
|
||||
bool nativevalue_to_se(ccstd::variant<ARGS...> *from, se::Value &to, se::Object *ctx) { // NOLINT
|
||||
return nativevalue_to_se(*from, to, ctx);
|
||||
if (from != nullptr) {
|
||||
return nativevalue_to_se(*from, to, ctx);
|
||||
}
|
||||
to.setNull();
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
||||
Reference in New Issue
Block a user