New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when recipes are set up incorrectly #282

Closed
vegardlarsen opened this Issue Nov 15, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@vegardlarsen
Member

vegardlarsen commented Nov 15, 2018

The following recipe will lead to a crash:

    {
      "name": "foo",
      "hotkey": "Windows+NumPad1",
      "ingredients": [
        {
          "command": "regions:apply",
          "parameters": {
            "monitor": "XTXXK43PAF5L",
            "name": "MainMonitorPrimary"
          }
        },
        {
          "command": "regions:apply",
          "parameters": {
            "monitor": "",
            "name": ""
          }
        },
        {
          "command": "regions:apply",
          "parameters": {
            "monitor": "HTJK100126",
            "name": "Standard"
          }
        }
      ]
    }

Stack trace:

2018-11-02 11:38:21 [MaxTo.Core@2.0.0.318] [Warning] Received exception from command request 2 while executing '"PrimaryRegions"'. Aborting.
Newtonsoft.Json.JsonReaderException: Error reading JObject from JsonReader. Current JsonReader item is not an object: Null. Path 'active', line 3, position 16.
   at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
   at MaxTo.Core.Settings.JsonCreationConverter`1.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at MaxTo.Core.Settings.CoreMonitorConfigurationManager.<.ctor>b__0_0(Object sender, ConfigurationChangedEventArgs args)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at MaxTo.Core.Settings.FileBasedConfigurationStore.<WriteConfiguration>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MaxTo.Core.Settings.CoreMonitorConfigurationManager.<UpdateConfiguration>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MaxTo.Core.Regions.RegionService.<SetActiveRegionForMonitor>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MaxTo.Core.Regions.RegionService.<SetActiveRegionForMonitor>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MaxTo.Core.Commands.Regions.ApplyCommand.<Execute>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MaxTo.Core.Commands.CommandExecutor.<Execute>d__3`2.MoveNext()

@vegardlarsen vegardlarsen added the bug label Nov 15, 2018

@vegardlarsen vegardlarsen self-assigned this Nov 15, 2018

@vegardlarsen vegardlarsen added this to the 2.0.0-beta.3 milestone Nov 15, 2018

@vegardlarsen

This comment has been minimized.

Member

vegardlarsen commented Nov 15, 2018

This has been fixed and will be in beta.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment