diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-24 11:15:50 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-24 11:15:50 +0200 |
commit | 452f24128791a27511fcebbff8fdecc4f3151d49 (patch) | |
tree | 8ff6dca0ecd5f4d01d2554b83d8235d4cc823e01 /src/lindafactory.cpp | |
parent | 9f4701efaa2167e915518f01ef9d61185377196d (diff) | |
download | lanes-452f24128791a27511fcebbff8fdecc4f3151d49.tar.gz lanes-452f24128791a27511fcebbff8fdecc4f3151d49.tar.bz2 lanes-452f24128791a27511fcebbff8fdecc4f3151d49.zip |
Fix wrong Linda name when not giving any
Diffstat (limited to 'src/lindafactory.cpp')
-rw-r--r-- | src/lindafactory.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lindafactory.cpp b/src/lindafactory.cpp index d5ebc9b..771a4c3 100644 --- a/src/lindafactory.cpp +++ b/src/lindafactory.cpp | |||
@@ -105,7 +105,7 @@ std::string_view LindaFactory::moduleName() const | |||
105 | DeepPrelude* LindaFactory::newDeepObjectInternal(lua_State* const L_) const | 105 | DeepPrelude* LindaFactory::newDeepObjectInternal(lua_State* const L_) const |
106 | { | 106 | { |
107 | // we always expect name and group at the bottom of the stack (either can be nil). any extra stuff we ignore and keep unmodified | 107 | // we always expect name and group at the bottom of the stack (either can be nil). any extra stuff we ignore and keep unmodified |
108 | std::string_view _linda_name{ luaG_tostring(L_, 1) }; | 108 | std::string_view _linda_name{ lua_isnil(L_, 1) ? "" : luaG_tostring(L_, 1) }; |
109 | LindaGroup _linda_group{ static_cast<int>(lua_tointeger(L_, 2)) }; | 109 | LindaGroup _linda_group{ static_cast<int>(lua_tointeger(L_, 2)) }; |
110 | 110 | ||
111 | // store in the linda the location of the script that created it | 111 | // store in the linda the location of the script that created it |