Skip to content

Commit 977f928

Browse files
committed
- fix division by zero for percentage drop
Took 8 minutes
1 parent 023bb8a commit 977f928

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/Helpers/StoresAvailable/StoreTemplate.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ public function check_notification(): bool
224224
return true;
225225
}
226226

227-
228227
if (config('settings.notify_any_change') && $this->price_crawled_and_different_from_database()) {
229228
$this->ntfy_tags .= ",Any Change";
230229
$this->notify();
@@ -333,6 +332,7 @@ public function price_reached_dropped_percentage(): bool
333332
{
334333
return $this->price &&
335334
$this->current_record->notify_percentage &&
335+
$this->current_record->price &&
336336
(($this->current_record->price - $this->price) / $this->current_record->price) * 100 >= $this->current_record->notify_percentage;
337337
}
338338

@@ -666,6 +666,7 @@ public function get_product_schema(string $script_type): array
666666
return json_decode($single_script->__toString(), true);
667667
}
668668
}
669+
669670
return [];
670671
}
671672

0 commit comments

Comments
 (0)