Do not crash if the layout user directory does not exist yet.

[DEVELOPMENT ENVIRONMENT]
* BUG: Do not crash if the layout user directory does not exist yet.
This commit is contained in:
gambas 2020-01-24 10:27:35 +01:00
parent 902fd4aae2
commit b7a7393b1a

View file

@ -1661,12 +1661,14 @@ Private Sub RefreshLayout()
$aLayout.Add(Html(sName)) $aLayout.Add(Html(sName))
Next Next
For Each sFile In Dir(sDir, "*.layout").Sort(gb.Natural) If IsDir(sDir) Then
sName = File.BaseName(sFile) For Each sFile In Dir(sDir, "*.layout").Sort(gb.Natural)
$aLayout.Add(sName) sName = File.BaseName(sFile)
If $cLayoutName.Exist(sName) Then sName = $cLayoutName[sName] $aLayout.Add(sName)
$aLayout.Add(Html(sName)) If $cLayoutName.Exist(sName) Then sName = $cLayoutName[sName]
Next $aLayout.Add(Html(sName))
Next
Endif
gvwLayout.Rows.Count = $aLayout.Count \ 2 gvwLayout.Rows.Count = $aLayout.Count \ 2