summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-02-21 09:46:47 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-02-21 09:46:47 +0800
commit44a6f010a4f7a699bdda5071c4de981499b544c1 (patch)
tree6ebc998cede8ba07339e54c7568dc2ce81574780
parent0d474d9483b797e2ff6996f752d057bc144f2311 (diff)
Send nullptrs when receiving empty strings
-rw-r--r--member.cxx27
1 files changed, 18 insertions, 9 deletions
diff --git a/member.cxx b/member.cxx
index aa0c66d..3f97dfd 100644
--- a/member.cxx
+++ b/member.cxx
@@ -348,15 +348,24 @@ namespace QInterchange {
QString const& state, QString const& zip,
QString const& email, QString const& phoneDay)
{
- interchange_member_setaccount(firstName.toLatin1().constData(),
- lastName.toLatin1().constData(),
- address1.toLatin1().constData(),
- address2.toLatin1().constData(),
- city.toLatin1().constData(),
- state.toLatin1().constData(),
- zip.toLatin1().constData(),
- email.toLatin1().constData(),
- phoneDay.toLatin1().constData());
+ interchange_member_setaccount(firstName == ""
+ ? nullptr : firstName.toLatin1().constData(),
+ lastName == ""
+ ? nullptr : lastName.toLatin1().constData(),
+ address1 == ""
+ ? nullptr : address1.toLatin1().constData(),
+ address2 == ""
+ ? nullptr : address2.toLatin1(). constData(),
+ city == ""
+ ? nullptr : city.toLatin1(). constData(),
+ state == ""
+ ? nullptr : state.toLatin1(). constData(),
+ zip == ""
+ ? nullptr : zip.toLatin1(). constData(),
+ email == ""
+ ? nullptr : email.toLatin1(). constData(),
+ phoneDay == ""
+ ? nullptr : phoneDay.toLatin1().constData());
}
void Member::changePassword(QString const& passwordOld, QString const& password,