pkulchenko / ZeroBraneStudio

Lightweight Lua-based IDE for Lua with code completion, syntax highlighting, live coding, remote debugger, and code analyzer; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and other Lua interpreters on Windows, macOS, and Linux
http://studio.zerobrane.com/
Other
2.62k stars 518 forks source link

check ide:IsSameDirectoryPath params #1021

Closed tkokof closed 4 years ago

tkokof commented 4 years ago

package.lua contains dir path check method:

function ide:IsSameDirectoryPath(s1, s2) return wx.wxFileName.DirName(s1):SameAs(wx.wxFileName.DirName(s2)) end

in some situations, ide:IsSameDirectoryPath can get nil params which will cause native error, seems a simple param checking can solve this ?

function ide:IsSameDirectoryPath(s1, s2) if s1 and s2 then return wx.wxFileName.DirName(s1):SameAs(wx.wxFileName.DirName(s2)) end return false end

pkulchenko commented 4 years ago

@tkokof, thank you for the suggestion. I'll apply (a slightly different, but with the same functional effect) patch.