Account for file.Open returning nil

This commit is contained in:
Redox 2023-07-07 19:14:43 +02:00
parent e78fb28d75
commit 94f90fd08b
No known key found for this signature in database
GPG Key ID: C10A433A95068388

View File

@ -22,11 +22,11 @@ end
function CACHE:AddItem(itemId, data)
local hash = self:GetItemIdHash (itemId)
local path = self.Path .. "/" .. hash .. ".txt"
local key = self:GetItemIdEncryptionKey (itemId)
-- Version
local f = file.Open (path, "wb", "DATA")
if not f then return end
f:WriteLong (self.Version)
-- Header