Skip to content

Commit b83f6fd

Browse files
authored
Add a few missing error checks. Fixes: #402
1 parent 1a9972b commit b83f6fd

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lua/advdupe2/sh_codec.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,13 @@ local function deserialize(str, read)
343343
tables = {}
344344
reference = 0
345345
buff = file.Open("ad2temp.txt","wb","DATA")
346+
if not buff then error("Failed to open file data/ad2temp.txt for writing!") end
346347
buff:Write(str)
347348
buff:Flush()
348349
buff:Close()
349350

350351
buff = file.Open("ad2temp.txt","rb", "DATA")
352+
if not buff then error("Failed to open file data/ad2temp.txt for reading!") end
351353
local success, tbl = pcall(read)
352354
buff:Close()
353355

0 commit comments

Comments
 (0)