Skip to content

Commit

Permalink
Fixed NPE when PBO Prefix is not being set
Browse files Browse the repository at this point in the history
  • Loading branch information
X39 committed Mar 10, 2020
1 parent b617d53 commit 797218e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
if (value is string str)
{
str = str.TrimStart('\\', '/', ' ', '\t');
var pbo = (Application.Current as IApp).MainWindow.FileManagement.FirstOrDefault((it) => str.StartsWith(it.FullPath, StringComparison.InvariantCultureIgnoreCase) || str.StartsWith(it.Prefix, StringComparison.InvariantCultureIgnoreCase));
var pbo = (Application.Current as IApp).MainWindow.FileManagement.FirstOrDefault((it) => str.StartsWith(it.FullPath, StringComparison.InvariantCultureIgnoreCase) || (!String.IsNullOrWhiteSpace(it.Prefix) && str.StartsWith(it.Prefix, StringComparison.InvariantCultureIgnoreCase)));
if (pbo is null)
{
return null;
Expand Down

0 comments on commit 797218e

Please sign in to comment.