Skip to content

Commit

Permalink
cppcheck: Fix "no current exception to rethrow" warnings.
Browse files Browse the repository at this point in the history
These two locations aren't in "catch" clauses, so there definitely
isn't anything to rethrow. To prevent the system from calling
std::terminate, give these two locations something to throw.
  • Loading branch information
linuxdude42 committed Jan 3, 2023
1 parent a8f3d51 commit ed43659
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mythtv/libs/libmythupnp/servicehost.cpp
Expand Up @@ -31,7 +31,7 @@ QVariant MethodInfo::Invoke( Service *pService, const QStringMap &reqParams ) co
QStringMap lowerParams;

if (!pService)
throw;
throw QString("Invalid argument to MethodInfo::Invoke. pService in nullptr");

// Change params to lower case for case-insensitive comparison
for (auto it = reqParams.cbegin(); it != reqParams.cend(); ++it)
Expand Down Expand Up @@ -109,7 +109,8 @@ QVariant MethodInfo::Invoke( Service *pService, const QStringMap &reqParams ) co
LOG(VB_GENERAL, LOG_ERR,
QString("MethodInfo::Invoke - Type unknown '%1'")
.arg(sParamType));
throw;
throw QString("MethodInfo::Invoke - Type unknown '%1'")
.arg(sParamType);
}

types[nIdx+1] = nId;
Expand Down

0 comments on commit ed43659

Please sign in to comment.