1
0
mirror of https://github.com/cmur2/dyndnsd.git synced 2025-08-08 08:33:56 +02:00

dyndnsd: handle potential nil cases detected by sorbet

- including review suggestions from @jgraichen
This commit is contained in:
cn
2020-02-28 16:44:27 +01:00
parent 0317189057
commit af5e4ca3e0
5 changed files with 18 additions and 6 deletions

View File

@@ -15,7 +15,7 @@ module Dyndnsd
# @return [void]
def load
if File.file?(@db_file)
@db = JSON.parse(File.open(@db_file, 'r', &:read))
@db = JSON.parse(File.read(@db_file, mode: 'r'))
else
@db = {}
end