mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-26 17:36:05 -05:00
fix dangling string crash on modpopup
This commit is contained in:
parent
ecec11fa93
commit
9834cb2a22
1 changed files with 9 additions and 4 deletions
|
@ -51,11 +51,16 @@ protected:
|
|||
}
|
||||
|
||||
void onRequest(Request::Event* event) {
|
||||
if (event->getValue() && event->getValue()->isOk() && event->getValue()->inspect([](auto&& value) { return value.has_value(); })) {
|
||||
m_loading->removeFromParent();
|
||||
m_textarea->setString(event->getValue()->unwrap()->c_str());
|
||||
if (auto* res = event->getValue(); res && res->isOk()) {
|
||||
auto value = std::move(*res).unwrap();
|
||||
if (value) {
|
||||
m_loading->removeFromParent();
|
||||
std::string str = std::move(value).value();
|
||||
m_textarea->setString(str.c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!event->getProgress()) {
|
||||
if (!event->getProgress()) {
|
||||
m_loading->removeFromParent();
|
||||
m_textarea->setString(m_noneText.c_str());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue