File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,11 @@ private async void PopulatePinnedSidebarItems()
115
115
try
116
116
{
117
117
App . SidebarPinned = JsonConvert . DeserializeObject < SidebarPinnedModel > ( await FileIO . ReadTextAsync ( pinnedItemsFile ) ) ;
118
+ if ( App . SidebarPinned == null )
119
+ {
120
+ App . SidebarPinned = new SidebarPinnedModel ( ) ;
121
+ throw new Exception ( SidebarPinnedModel . JsonFileName + " is empty, regenerating..." ) ;
122
+ }
118
123
}
119
124
catch ( Exception )
120
125
{
@@ -237,6 +242,11 @@ private async void LoadTerminalApps()
237
242
try
238
243
{
239
244
TerminalsModel = JsonConvert . DeserializeObject < TerminalFileModel > ( content ) ;
245
+ if ( TerminalsModel == null )
246
+ {
247
+ TerminalsModel = new TerminalFileModel ( ) ;
248
+ throw new JsonSerializationException ( "terminal.json is empty, regenerating..." ) ;
249
+ }
240
250
}
241
251
catch ( JsonSerializationException )
242
252
{
You can’t perform that action at this time.
0 commit comments