Skip to content

Commit

Permalink
Fixed: When adding an empty "Selector" Block, the app crashes (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo-Peyronnet committed Nov 5, 2021
1 parent 778cd4b commit 5ab9064
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 2 deletions.
18 changes: 18 additions & 0 deletions Datalya/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Datalya/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1190,4 +1190,10 @@ Europe</value>
<data name="ContentCollectionsDesc" xml:space="preserve">
<value>Quickly insert a usefull collection to your Selector Block.</value>
</data>
<data name="PleaseAddItemSelectorBlock" xml:space="preserve">
<value>Please add at least one choice to the Selector Block.</value>
</data>
<data name="DatalyaCreator" xml:space="preserve">
<value>Datalya Creator</value>
</data>
</root>
10 changes: 8 additions & 2 deletions Datalya/Properties/Resources.fr-FR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
<value>Choix unique</value>
</data>
<data name="Selector" xml:space="preserve">
<value>Selecteur</value>
<value>Sélecteur</value>
</data>
<data name="Properties" xml:space="preserve">
<value>Propriétés</value>
Expand Down Expand Up @@ -310,7 +310,7 @@
<value>Exporter en tant que modèle</value>
</data>
<data name="Select" xml:space="preserve">
<value>Selectionner</value>
<value>Sélectionner</value>
</data>
<data name="Cancel" xml:space="preserve">
<value>Annuler</value>
Expand Down Expand Up @@ -1243,4 +1243,10 @@ Europe</value>
<data name="ContentCollectionsDesc" xml:space="preserve">
<value>Insérez rapidement une collection utile dans votre Block Sélecteur.</value>
</data>
<data name="PleaseAddItemSelectorBlock" xml:space="preserve">
<value>Veuillez ajouter au moins un choix au Block Sélecteur.</value>
</data>
<data name="DatalyaCreator" xml:space="preserve">
<value>Créateur Datalya</value>
</data>
</root>
6 changes: 6 additions & 0 deletions Datalya/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1170,4 +1170,10 @@ Europe</value>
<data name="ContentCollectionsDesc" xml:space="preserve">
<value>Quickly insert a usefull collection to your Selector Block.</value>
</data>
<data name="PleaseAddItemSelectorBlock" xml:space="preserve">
<value>Please add at least one choice to the Selector Block.</value>
</data>
<data name="DatalyaCreator" xml:space="preserve">
<value>Datalya Creator</value>
</data>
</root>
6 changes: 6 additions & 0 deletions Datalya/UserControls/SelectorBlockPropertiesUI.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ public SelectorBlockPropertiesUI(SelectorBlockCreatorUI selectorBlockCreatorUI,

private void SaveBtn_Click(object sender, RoutedEventArgs e)
{
if (string.IsNullOrEmpty(ChoicesTxt.Text) || string.IsNullOrWhiteSpace(ChoicesTxt.Text))
{
MessageBox.Show(Properties.Resources.PleaseAddItemSelectorBlock, $"{Properties.Resources.DatalyaCreator} - {Properties.Resources.Selector}", MessageBoxButton.OK, MessageBoxImage.Error);
return; // Stop
}

if (!string.IsNullOrEmpty(NameTxt.Text) && !string.IsNullOrWhiteSpace(NameTxt.Text))
{
// Name
Expand Down

0 comments on commit 5ab9064

Please sign in to comment.