Fix exception when adjusting mail settings, closes #907

This commit is contained in:
Dane Everitt 2018-02-03 12:28:39 -06:00
parent 48c933fa0f
commit d9355b93b4
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 14 additions and 12 deletions

View file

@ -30,17 +30,17 @@ class SettingsRepository extends EloquentRepository implements SettingsRepositor
/**
* Store a new persistent setting in the database.
*
* @param string $key
* @param string $value
* @param string $key
* @param string|null $value
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/
public function set(string $key, string $value)
public function set(string $key, string $value = null)
{
// Clear item from the cache.
$this->clearCache($key);
$this->withoutFreshModel()->updateOrCreate(['key' => $key], ['value' => $value]);
$this->withoutFreshModel()->updateOrCreate(['key' => $key], ['value' => $value ?? '']);
self::$cache[$key] = $value;
}