Skip to content

Commit 80fea3f

Browse files
committed
Fix missing datSource on new installs
1 parent d197f15 commit 80fea3f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/Export/Classes/GGPKSourceListControl.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function GGPKSourceListClass:EditDATSource(datSource, newSource)
4343
controls.save.enabled = (controls.dat.buf:match("%S") or controls.ggpk.buf:match("%S")) and controls.label.buf:match("%S") and buf:match("%S")
4444
end)
4545
controls.save = new("ButtonControl", {"TOP",controls.spec,"TOP"}, {-45, 22, 80, 20}, "Save", function()
46-
local reload = datSource.label == main.datSource.label
46+
local reload = not main.datSource or (datSource.label == main.datSource.label)
4747
datSource.label = controls.label.buf
4848
datSource.ggpkPath = controls.ggpk.buf or ""
4949
datSource.datFilePath = controls.dat.buf or ""

src/Export/Main.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,12 @@ end
334334

335335
function main:LoadDatSource(value)
336336
self.leagueLabel = nil
337-
local out = io.open(self.datSource.spec..(self.datSource.spec:match("%.lua$") and "" or ".lua"), "w")
338-
out:write('return ')
339-
writeLuaTable(out, self.datSpecs, 1)
340-
out:close()
337+
if self.datSource then
338+
local out = io.open(self.datSource.spec..(self.datSource.spec:match("%.lua$") and "" or ".lua"), "w")
339+
out:write('return ')
340+
writeLuaTable(out, self.datSpecs, 1)
341+
out:close()
342+
end
341343
self.datSource = value
342344
self.datSpecs = LoadModule(self.datSource.spec)
343345
self:InitGGPK()

0 commit comments

Comments
 (0)