db/proxy, output/shout: fix implicit nullptr/bool conversion
Return false on error, not nullptr.
This commit is contained in:
parent
df33171107
commit
665031467a
|
@ -592,7 +592,7 @@ ProxyDatabase::Visit(const DatabaseSelection &selection,
|
||||||
{
|
{
|
||||||
// TODO: eliminate the const_cast
|
// TODO: eliminate the const_cast
|
||||||
if (!const_cast<ProxyDatabase *>(this)->EnsureConnected(error))
|
if (!const_cast<ProxyDatabase *>(this)->EnsureConnected(error))
|
||||||
return nullptr;
|
return false;
|
||||||
|
|
||||||
if (!visit_directory && !visit_playlist && selection.recursive &&
|
if (!visit_directory && !visit_playlist && selection.recursive &&
|
||||||
(ServerSupportsSearchBase(connection)
|
(ServerSupportsSearchBase(connection)
|
||||||
|
@ -617,7 +617,7 @@ ProxyDatabase::VisitUniqueTags(const DatabaseSelection &selection,
|
||||||
{
|
{
|
||||||
// TODO: eliminate the const_cast
|
// TODO: eliminate the const_cast
|
||||||
if (!const_cast<ProxyDatabase *>(this)->EnsureConnected(error))
|
if (!const_cast<ProxyDatabase *>(this)->EnsureConnected(error))
|
||||||
return nullptr;
|
return false;
|
||||||
|
|
||||||
enum mpd_tag_type tag_type2 = Convert(tag_type);
|
enum mpd_tag_type tag_type2 = Convert(tag_type);
|
||||||
if (tag_type2 == MPD_TAG_COUNT) {
|
if (tag_type2 == MPD_TAG_COUNT) {
|
||||||
|
@ -657,7 +657,7 @@ ProxyDatabase::GetStats(const DatabaseSelection &selection,
|
||||||
|
|
||||||
// TODO: eliminate the const_cast
|
// TODO: eliminate the const_cast
|
||||||
if (!const_cast<ProxyDatabase *>(this)->EnsureConnected(error))
|
if (!const_cast<ProxyDatabase *>(this)->EnsureConnected(error))
|
||||||
return nullptr;
|
return false;
|
||||||
|
|
||||||
struct mpd_stats *stats2 =
|
struct mpd_stats *stats2 =
|
||||||
mpd_run_stats(connection);
|
mpd_run_stats(connection);
|
||||||
|
|
|
@ -114,7 +114,7 @@ ShoutOutput::Configure(const config_param ¶m, Error &error)
|
||||||
if (!audio_format.IsFullyDefined()) {
|
if (!audio_format.IsFullyDefined()) {
|
||||||
error.Set(config_domain,
|
error.Set(config_domain,
|
||||||
"Need full audio format specification");
|
"Need full audio format specification");
|
||||||
return nullptr;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *host = require_block_string(param, "host");
|
const char *host = require_block_string(param, "host");
|
||||||
|
|
Loading…
Reference in New Issue