Skip to content

Commit

Permalink
Fix file storage confition in case file not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
punyflash committed Nov 20, 2023
1 parent 62a228f commit 71ae1f6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<p align="center">
<a href="https://packagist.org/packages/westacks/telebot"><img src="https://poser.pugx.org/westacks/telebot/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://core.telegram.org/bots/api"><img src="https://img.shields.io/badge/Bot%20API-6.8-blue" alt="Bot API Version"></a>
<a href="https://core.telegram.org/bots/api"><img src="https://img.shields.io/badge/Bot%20API-6.9-blue" alt="Bot API Version"></a>
<a href="https://packagist.org/packages/westacks/telebot"><img src="https://poser.pugx.org/westacks/telebot/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/westacks/telebot"><img src="https://poser.pugx.org/westacks/telebot/license.svg" alt="License"></a>
<a href="https://github.com/westacks/telebot/actions/workflows/main.yml"><img src="https://github.com/westacks/telebot/actions/workflows/main.yml/badge.svg" alt="PHPUnit"></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p id="telebot" align="center">
<a href="https://github.com/westacks/telebot" class="app-name-link"><img src="/assets/logo.svg" alt="Project Logo"></a><br>
<a href="https://packagist.org/packages/westacks/telebot"><img src="https://poser.pugx.org/westacks/telebot/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://core.telegram.org/bots/api"><img src="https://img.shields.io/badge/Bot%20API-6.8-blue" alt="Bot API Version"></a>
<a href="https://core.telegram.org/bots/api"><img src="https://img.shields.io/badge/Bot%20API-6.9-blue" alt="Bot API Version"></a>
<a href="https://packagist.org/packages/westacks/telebot"><img src="https://poser.pugx.org/westacks/telebot/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/westacks/telebot"><img src="https://poser.pugx.org/westacks/telebot/license.svg" alt="License"></a>
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/JsonStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __destruct()
}

if (empty($this->data)) {
return unlink($this->path);
return @unlink($this->path);
}

file_put_contents($this->path, json_encode($this->data));
Expand Down

0 comments on commit 71ae1f6

Please sign in to comment.