From b7a7393b1ab5eaef2c7e05d2ffdb3b60ab4a5631 Mon Sep 17 00:00:00 2001 From: gambas Date: Fri, 24 Jan 2020 10:27:35 +0100 Subject: [PATCH] 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. --- app/src/gambas3/.src/Options/FOption.class | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/src/gambas3/.src/Options/FOption.class b/app/src/gambas3/.src/Options/FOption.class index d2cf2b005..2072631eb 100644 --- a/app/src/gambas3/.src/Options/FOption.class +++ b/app/src/gambas3/.src/Options/FOption.class @@ -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