mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Use script_nil instead of creating ScriptObjects with null pointers.
Fixes #18
This commit is contained in:
@@ -408,7 +408,11 @@ inline ScriptValueP to_script(const IndexMap<K,V>* v) {
|
||||
}
|
||||
template <typename T>
|
||||
inline ScriptValueP to_script(const intrusive_ptr<T>& v) {
|
||||
return make_intrusive<ScriptObject<intrusive_ptr<T>>>(v);
|
||||
if (v) {
|
||||
return make_intrusive<ScriptObject<intrusive_ptr<T>>>(v);
|
||||
} else {
|
||||
return script_nil;
|
||||
}
|
||||
}
|
||||
template <typename T>
|
||||
inline ScriptValueP to_script(const Defaultable<T>& v) {
|
||||
|
||||
Reference in New Issue
Block a user