[notabug] SetText() with gsub operation crashes game
I have a couple of undocumented functions from the old author of the Notebook 2018 addon. They look like:
Code:
function NBUI.ProtectText(text) Code:
NBUI.NB1RightPage_Title:SetText(NBUI.UnprotectText(title)) I couldn't load the game with it. Other users reported errors only. I removed them, assuming that by now the game handles string issues better than years ago. This is to help the devs figure out the issue further, to avoid future crashes. :) Thanks! |
Quote:
SetText takes two parameters. But the second must be boolean. gsub returns int. => boom You can not directly use gsub and SetText in one operation. => Lua Code:
|
Quote:
|
Quote:
Regardless of language or project, one should never pass variable returns directly into functions that are maintained by a third party. Otherwise there will be surprises like that in case the function is updated to accept new arguments. ;) |
All times are GMT -6. The time now is 08:51 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI