Base: Add isNullOrEmpty string helper

This adds isNullOrEmpty string helper that cheks if string is... well
null or empty. It is done to improve readability of the code and better
express intent.
This commit is contained in:
Kacper Donat
2025-02-20 17:47:06 +01:00
parent 8c8179feb9
commit cc2efa90f8
47 changed files with 113 additions and 72 deletions

View File

@@ -42,6 +42,8 @@
#include "Exception.h"
#include "Interpreter.h"
#include <Tools.h>
namespace Base
{
@@ -73,7 +75,7 @@ public:
Py::Tuple args(2);
args.setItem(0, Py::asObject(GetPyObject(hGrp)));
// A Reason of null indicates to clear the parameter group
if (Reason && Reason[0] != '\0') {
if (!Base::Tools::isNullOrEmpty(Reason)) {
args.setItem(1, Py::String(Reason));
}
method.apply(args);