Change: Don't handle 'missing' string parameters as 0. (#11673)
If not enough parameters are supplied for a string, then a value of 0 was used, which could result in incorrect information being displayed. Instead, throw an exception and include an error in the string.
This commit is contained in:
@@ -95,7 +95,7 @@ public:
|
||||
T GetNextParameter()
|
||||
{
|
||||
auto ptr = GetNextParameterPointer();
|
||||
return static_cast<T>(ptr == nullptr ? 0 : ptr->data);
|
||||
return static_cast<T>(ptr->data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,6 @@ public:
|
||||
const char *GetNextParameterString()
|
||||
{
|
||||
auto ptr = GetNextParameterPointer();
|
||||
if (ptr == nullptr) return nullptr;
|
||||
return ptr->string != nullptr ? ptr->string->c_str() : ptr->string_view;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user