Skip to content

Commit 0539764

Browse files
committed
Fix nullable warnings
1 parent 81ae150 commit 0539764

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

Flow.Launcher.Plugin.OneNote/Keywords.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public class Keyword
2626
public int Length => Value.Length;
2727
public static implicit operator string(Keyword keyword) => keyword.Value;
2828
public override string ToString() => Value;
29+
30+
public static Keyword Empty { get; } = new ("");
2931
}
3032

3133
//Needed for legacy as keywords where just saved as a string

Flow.Launcher.Plugin.OneNote/Search/DefaultSearch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Flow.Launcher.Plugin.OneNote.Search
66
{
77
public class DefaultSearch(PluginInitContext context, Settings settings, ResultCreator resultCreator)
8-
: SearchBase(context, settings, resultCreator, null)
8+
: SearchBase(context, settings, resultCreator, Keyword.Empty)
99
{
1010
public override List<Result> GetResults(Query query)
1111
{

Flow.Launcher.Plugin.OneNote/Search/SearchBase.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@
22

33
namespace Flow.Launcher.Plugin.OneNote.Search
44
{
5-
public abstract class SearchBase(PluginInitContext context, Settings settings, ResultCreator resultCreator, Keyword? keyword)
5+
public abstract class SearchBase(PluginInitContext context, Settings settings, ResultCreator resultCreator, Keyword keyword)
66
{
77
protected readonly PluginInitContext context = context;
88
protected readonly Settings settings = settings;
99
protected readonly ResultCreator resultCreator = resultCreator;
10-
#nullable disable
1110
public readonly Keyword keyword = keyword;
12-
#nullable restore
1311
protected Keywords Keywords => settings.Keywords;
1412
public abstract List<Result> GetResults(Query query);
15-
1613
}
1714
}

0 commit comments

Comments
 (0)