diff --git a/app/Services/VoucherSetService.php b/app/Services/VoucherSetService.php index 3e5cac04..d0632b4a 100644 --- a/app/Services/VoucherSetService.php +++ b/app/Services/VoucherSetService.php @@ -20,7 +20,7 @@ public static function validateVoucherSetDenominations(VoucherSet $voucherSet): $denominationArray = json_decode($voucherSet->denomination_json, true); - if (count($denominationArray) == 0) { + if (is_null($denominationArray) || count($denominationArray) == 0) { return false; } diff --git a/database/factories/VoucherSetFactory.php b/database/factories/VoucherSetFactory.php index 782bd755..0e039cd3 100644 --- a/database/factories/VoucherSetFactory.php +++ b/database/factories/VoucherSetFactory.php @@ -28,6 +28,7 @@ public function definition(): array 'num_voucher_redemptions' => $this->faker->numberBetween(1, 10), 'expires_at' => now()->addDays(30), 'voucher_set_type' => fake()->randomElement(VoucherSetType::values()), + 'currency_country_id' => 14, ]; } }