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))
Next
For Each sFile In Dir(sDir, "*.layout").Sort(gb.Natural)
sName = File.BaseName(sFile)
$aLayout.Add(sName)
If $cLayoutName.Exist(sName) Then sName = $cLayoutName[sName]
$aLayout.Add(Html(sName))
Next
If IsDir(sDir) Then
For Each sFile In Dir(sDir, "*.layout").Sort(gb.Natural)
sName = File.BaseName(sFile)
$aLayout.Add(sName)
If $cLayoutName.Exist(sName) Then sName = $cLayoutName[sName]
$aLayout.Add(Html(sName))
Next
Endif
gvwLayout.Rows.Count = $aLayout.Count \ 2