Skip to content

Commit

Permalink
fix initial case where pages.json is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Hübner committed Jan 11, 2020
1 parent de7e9d4 commit ee70140
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SeeSharp/Models/State.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class State
{
public State()
{
Pages = new Bindable<SortedList<BindablePage>>();
Pages = new Bindable<SortedList<BindablePage>>(new SortedList<BindablePage>());
}

[JsonProperty("default_speed")]
Expand Down
8 changes: 6 additions & 2 deletions SeeSharp/Sync/SyncManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ public void Load()
catch (IOException e)
{
Logger.Error(e, "failed to retrieve config. Supplying standard config instead.");
state = new State();
state = new State()
{
DefaultSpeed = 0.3f,
DefaultZoom = 1.0f
};
}

var registeredFileNames = state.Pages.Value.Select(p => p.Value.Name);

//add pages which have not been registered yet.
Expand Down

0 comments on commit ee70140

Please sign in to comment.