Skip to content

Lane.GetLinks | InvalidOperationException: Sequence contains no elements #24

Open

Description

@NiklasDanz

When calling client.Lane.GetLinks(someLaneID), I get the following error:

InvalidOperationException: Sequence contains no elements
System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
CodingConnected.TraCI.NET.Helpers.TraCIDataConverter.GetValueFromTypeAndArray (System.Byte type, System.Collections.Generic.IEnumerable`1[T] array, System.Object& Object) (at Assets/Scripts/Simulation/CodingConnected.TraCI.NET/Helpers/TraCIDataConverter.cs:781)
CodingConnected.TraCI.NET.Helpers.TraCIDataConverter.ExtractDataFromResponse[T] (CodingConnected.TraCI.NET.TraCIResult[] response, System.Byte commandType, System.Byte messageType) (at Assets/Scripts/Simulation/CodingConnected.TraCI.NET/Helpers/TraCIDataConverter.cs:47)
CodingConnected.TraCI.NET.Helpers.TraCICommandHelper.ExecuteGetCommand[T] (CodingConnected.TraCI.NET.TraCIClient client, System.String id, System.Byte commandType, System.Byte messageType) (at Assets/Scripts/Simulation/CodingConnected.TraCI.NET/Helpers/TraCICommandHelper.cs:121)
CodingConnected.TraCI.NET.Commands.LaneCommands.GetLinks (System.String id) (at Assets/Scripts/Simulation/CodingConnected.TraCI.NET/Commands/LaneCommands.cs:83)
SumoClientClass.MainLoop () (at Assets/Scripts/SumoClient/SumoClientClass.cs:93)

Activity

  1. mennowo commented on Aug 4, 2020

    @mennowo
    Contributor

    Hello @NiklasDanz, sorry for the delayed response.
    This line of code causes the exception, I guess: link
    The question is what causes the result to be empty. Are you able to debug this?
    There is also a related TODO here: link
    Would be great if you could do a PR, or alternatively provide a sample scenario where this occurs.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions