QxOrm
QxOrm copied to clipboard
Passing null-pointer to fetch functions generates no warning
Hello. Thank you for QxOrm)
Code like below executes without warnings. Is this expected behaviour? Maybe better to print something like "hey I cant put result into null pointer"?
// qx::dao::ptr<Something> something_ptr{new Something{}}; // when you forget about this
qx::dao::ptr<Something> something_ptr;
qx::QxSqlQuery query;
query.where("something_table.value").isEqualTo(value);
daoError = qx::dao::fetch_by_query(query, something_ptr);
if(daoError.type() != QSqlError::ErrorType::NoError){
qWarning() << daoError.text(); // not executed
}
Hello,
Maybe better to print something like "hey I cant put result into null pointer"?
Yes you are right, it would be better to add something in the output logs. I will not throw an assert or exception for that, but a trace is a good idea, thx !