Skip to content

Commit 01f9699

Browse files
committed
fix on delete initiative without city
1 parent 55df4d1 commit 01f9699

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Resource/InitiativeResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public function deleteInitiative($subject, $iniId, $options = [], $flags = 3)
204204
}
205205
$city = $init->city;
206206
$deleted = $init->delete();
207-
if ($deleted) {
207+
if (isset($city) && $deleted) {
208208
$city->decrement('initiatives_count');
209209
if ($city->initiatives_count == 0) {
210210
$city->delete();

0 commit comments

Comments
 (0)