Skip to content

Commit

Permalink
Fixed possible null exception in conditional actions using the descri…
Browse files Browse the repository at this point in the history
…ption field as a condition.
  • Loading branch information
HerrKnarz committed Oct 8, 2024
1 parent 8280eb0 commit d56adb5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Common/KNARZhelper/DatabaseObjectTypes/TypeDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ internal class TypeDescription : BaseStringType

public override void EmptyFieldInGame(Game game) => API.Instance.MainView.UIDispatcher.Invoke(() => game.Description = default);

public override bool FieldInGameIsEmpty(Game game) => !game.Description.Trim().Any();
public override bool FieldInGameIsEmpty(Game game) => !game?.Description?.Trim().Any() ?? true;

public override bool GameContainsValue(Game game, string value) => game.Description.RegExIsMatch(value);
public override bool GameContainsValue(Game game, string value) => value != null && (game?.Description?.RegExIsMatch(value) ?? false);
}
}
6 changes: 3 additions & 3 deletions Generic/MetadataUtilities/Views/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,11 @@
<DockPanel DockPanel.Dock="Bottom" Margin="0,10,0,0" LastChildFill="False">
<Button Content="&#xec3e;" DockPanel.Dock="Left" FontFamily="{DynamicResource FontIcoFont}" ToolTip="{DynamicResource LOCAddNewItem}"
Command="{Binding AddPrefixCommand}" />
<Button Content="&#xec53;" DockPanel.Dock="Left" FontFamily="{DynamicResource FontIcoFont}" ToolTip="{DynamicResource LOCRemoveTitle}" Margin="10,0,0,0"
Command="{Binding RemovePrefixCommand}"
<Button Content="&#xec53;" DockPanel.Dock="Left" FontFamily="{DynamicResource FontIcoFont}" ToolTip="{DynamicResource LOCRemoveTitle}"
Command="{Binding RemovePrefixCommand}" Margin="10,0,0,0"
CommandParameter="{Binding SelectedItems, ElementName=LvPrefixes}" />
<Button Content="&#xEFEE;" DockPanel.Dock="Left" FontFamily="{DynamicResource FontIcoFont}"
Command="{Binding SortPrefixesCommand}" />
Command="{Binding SortPrefixesCommand}" Margin="10,0,0,0" />
<Button Content="&#xEFCA;" DockPanel.Dock="Right" FontFamily="{DynamicResource FontIcoFont}" ToolTip="{DynamicResource LOCMenuHelpTitle}"
Command="{Binding HelpPrefixesCommand}" Margin="10,0,0,0" />
</DockPanel>
Expand Down
9 changes: 9 additions & 0 deletions Manifest/HerrKnarz_MetadataUtilities.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
AddonId: MetadataUtilities_485ab5f0-bfb1-4c17-93cc-20d8338673be
Packages:
- Version: 1.3.1
RequiredApiVersion: 6.11.0
ReleaseDate: 2024-10-08
PackageUrl: https://github.com/HerrKnarz/Playnite-Extensions/releases/download/2024-10-08/MetadataUtilities_485ab5f0-bfb1-4c17-93cc-20d8338673be_1_3_1.pext
Changelog:
- Added option to sort prefixes for display in the theme controls.
- Made custom controls styleable to make them work with most themes.
- Fixed disappearing controls when switching between grid and details view.
- Fixed possible null exception in conditional actions using the description field as a condition.
- Version: 1.3.0
RequiredApiVersion: 6.11.0
ReleaseDate: 2024-10-04
Expand Down

0 comments on commit d56adb5

Please sign in to comment.