Skip to content

Conversation

@microdee
Copy link

The spec format string for P4 versions prior 2020.2 shouldn't have contained Components field, this caused a runtime error manifested in a format-parameter-argument-count mismatch, when ParentView was None.

Suggestion outside the scope of this PR
To avoid such errors in the future, it is safer to use interpolated raw-string-literals introduced in C# 11:

                value = $"""
                        Stream:	{Id}

                        Update:	{FormBase.FormatDateTime(Updated)}

                        Access:	{FormBase.FormatDateTime(Accessed)}

                        Owner:	{OwnerName}

                        Name:	{Name}

                        Parent:	{ParentPath}

                        Type:	{Type}

                        Description:
                        	{descStr}

                        Options:	{_options}

                        Paths:
                        	{pathsView}

                        Remapped:
                        	{remappedView}

                        Ignored:
                        	{ignoredView}

                        {customFieldsString}
                        """;

Or if C# 11 is not feasible for this codebase then C# 6 interpolated string literals are also better for this purpose.

…ntained `Components` field, this caused a runtime error manifested in a format-parameter-argument-count mismatch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants