use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
+use Org\Mxchange\CoreFramework\Generic\NullPointerException;
use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
* @param $variableName The variable we are looking for
* @param $value The value we want to store in the variable
* @return void
+ * @throws NullPointerException If $variableName is NULL
* @throws InvalidArgumentException If the variable name is left empty
*/
public final function assignVariable ($variableName, $value) {
- // Replace all dashes to underscores to match variables with configuration entries
- $variableName = trim(StringUtils::convertDashesToUnderscores($variableName));
-
- // Empty variable found?
- if (empty($variableName)) {
+ // Validate parameter
+ if (is_null($variableName)) {
+ // Throw NPE
+ throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+ } elseif (empty($variableName)) {
// Throw an exception
throw new InvalidArgumentException('Parameter "variableName" is empty');
- } // END - if
+ }
+
+ // Replace all dashes to underscores to match variables with configuration entries
+ $variableName = trim(StringUtils::convertDashesToUnderscores($variableName));
// First search for the variable if it was already added
$index = $this->getVariableIndex($variableName);