[PR #613] [MERGED] Fix IndexOutOfRangeException in build command parsing logic #1229

Open
opened 2026-01-29 16:58:39 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ElectronNET/Electron.NET/pull/613
Author: @aguang-xyz
Created: 10/9/2021
Status: Merged
Merged: 2/21/2022
Merged by: @robertmuehsig

Base: masterHead: fix/npe-when-target-not-specified


📝 Commits (1)

  • 5cd152c Fix build command logic when target is not specified

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 ElectronNET.CLI/Commands/BuildCommand.cs (+1 -1)

📄 Description

Hi there,

Thanks for this great project so we can build electron app in C# smoothly. I just found a small issue in the build command parsing logic and commit a fix about this.

How to reproduce the issue?

$ electronize build /target
Build Electron Application...
Arguments: 
        target = 
Unhandled exception. System.AggregateException: One or more errors occurred. (Index was outside the bounds of the array.)
 ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at ElectronNET.CLI.Commands.BuildCommand.<ExecuteAsync>b__21_0() in C:\_WorkRepos\Electron.NET\ElectronNET.CLI\Commands\BuildCommand.cs:line 54
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__277_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at ElectronNET.CLI.Program.Main(String[] args) in C:\_WorkRepos\Electron.NET\ElectronNET.CLI\Program.cs:line 59
[1]    2879 abort      electronize build /target


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ElectronNET/Electron.NET/pull/613 **Author:** [@aguang-xyz](https://github.com/aguang-xyz) **Created:** 10/9/2021 **Status:** ✅ Merged **Merged:** 2/21/2022 **Merged by:** [@robertmuehsig](https://github.com/robertmuehsig) **Base:** `master` ← **Head:** `fix/npe-when-target-not-specified` --- ### 📝 Commits (1) - [`5cd152c`](https://github.com/ElectronNET/Electron.NET/commit/5cd152c1edff44b02143115de1085ae61258dfd9) Fix build command logic when target is not specified ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `ElectronNET.CLI/Commands/BuildCommand.cs` (+1 -1) </details> ### 📄 Description Hi there, Thanks for this great project so we can build electron app in C# smoothly. I just found a small issue in the build command parsing logic and commit a fix about this. ### How to reproduce the issue? ``` $ electronize build /target Build Electron Application... Arguments: target = Unhandled exception. System.AggregateException: One or more errors occurred. (Index was outside the bounds of the array.) ---> System.IndexOutOfRangeException: Index was outside the bounds of the array. at ElectronNET.CLI.Commands.BuildCommand.<ExecuteAsync>b__21_0() in C:\_WorkRepos\Electron.NET\ElectronNET.CLI\Commands\BuildCommand.cs:line 54 at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b__277_0(Object obj) at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of inner exception stack trace --- at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task`1.get_Result() at ElectronNET.CLI.Program.Main(String[] args) in C:\_WorkRepos\Electron.NET\ElectronNET.CLI\Program.cs:line 59 [1] 2879 abort electronize build /target ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 16:58:40 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#1229