File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ public static class Constants
7
7
public const string SyncIconPath = "Images/refresh.png" ;
8
8
public const string RecentIconPath = "Images/recent.png" ;
9
9
public const string RecentPageIconPath = "Images/recent_page.png" ;
10
-
10
+ public const string WarningLogoPath = "Images/warning.png" ;
11
+
11
12
public const string StructureKeyword = "nb:\\ " ;
12
13
public const string RecentKeyword = "rcntpgs:" ;
13
14
}
Original file line number Diff line number Diff line change @@ -112,6 +112,17 @@ public List<Result> Query(Query query)
112
112
if ( query . FirstSearch . StartsWith ( Constants . StructureKeyword ) )
113
113
return notebookExplorer . Explore ( query ) ;
114
114
115
+ //Check for invalid start of query i.e. symbols
116
+ if ( ! char . IsLetterOrDigit ( query . Search [ 0 ] ) )
117
+ return new List < Result > ( )
118
+ {
119
+ new Result
120
+ {
121
+ Title = "Invalid query" ,
122
+ SubTitle = "The first character of the search must be a letter or a digit" ,
123
+ IcoPath = Constants . WarningLogoPath ,
124
+ }
125
+ } ;
115
126
//Default search
116
127
var searches = OneNoteProvider . FindPages ( query . Search )
117
128
. Select ( pg => rc . CreatePageResult ( pg , context . API . FuzzySearch ( query . Search , pg . Name ) . MatchData ) ) ;
You can’t perform that action at this time.
0 commit comments