mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-23 07:57:51 -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) {
|
void onRequest(Request::Event* event) {
|
||||||
if (event->getValue() && event->getValue()->isOk() && event->getValue()->inspect([](auto&& value) { return value.has_value(); })) {
|
if (auto* res = event->getValue(); res && res->isOk()) {
|
||||||
|
auto value = std::move(*res).unwrap();
|
||||||
|
if (value) {
|
||||||
m_loading->removeFromParent();
|
m_loading->removeFromParent();
|
||||||
m_textarea->setString(event->getValue()->unwrap()->c_str());
|
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_loading->removeFromParent();
|
||||||
m_textarea->setString(m_noneText.c_str());
|
m_textarea->setString(m_noneText.c_str());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue