Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello SetText Error null #133

Open
KiraAmora61 opened this issue Jun 4, 2019 · 5 comments
Open

Hello SetText Error null #133

KiraAmora61 opened this issue Jun 4, 2019 · 5 comments

Comments

@KiraAmora61
Copy link

image

Old

void CUIMessageBox::SetText(const std::string& szMsg)
{
m_pText_Message->SetString(szMsg);
}

void CUIMessageBox::SetTitle(const std::string& szTitle)
{
m_pText_Title->SetString(szTitle);
}

New now

void CUIMessageBox::SetText(const std::string& szMsg)
{
if (NULL == m_pText_Message)
return;

m_pText_Message->SetString(szMsg);

}

void CUIMessageBox::SetTitle(const std::string& szTitle)
{
if (NULL == m_pText_Title)
return;

m_pText_Title->SetString(szTitle);

}

Is it true? -now thanks <3

@onurcanbektas
Copy link
Contributor

What is the question exactly ?,

@KiraAmora61
Copy link
Author

@onurcanbektas bang problem

@twostars
Copy link
Collaborator

twostars commented Jun 5, 2019

You might look into why the control's not loaded here, because that seems like more of a problem than the fact it's crashing.

@KiraAmora61
Copy link
Author

@twostars yes Can I get a skype address

@twostars
Copy link
Collaborator

twostars commented Jun 6, 2019

If m_pText_Message is nullptr it means the control's not loaded, which means either the UI needs updating or it's being used for a specialisation of a messagebox UI that isn't named the same.

You don't show a callstack here so I can't tell which instance is theoretically being used here, and I don't recall if there were changes in the naming for this UI, but it should be fairly straightforward to find out.
Load up the relevant UI in the UI editor and check what it's called, or just set a breakpoint there & check the names of the loaded children.

Checking if it's set stops it from crashing, but a messagebox without a message kind've defeats the purpose of said messagebox, so you should really find out why the control isn't attached here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants