Summary
On any non-Windows platform, constructing any BaseCommand-derived command crashes with an
unhandled NullReferenceException if the repository's repositories.json lists a UNC-style
repository and no credentials have ever been saved for it via cmf login. The crash happens during
CLI bootstrap/command-tree discovery — before any command's actual logic runs — so it breaks every
plugin command uniformly, not just the one the user is trying to run.
Where
-
core/Objects/ExecutionContext.cs, line 115 — the CIFS-connecting block is gated by
!RunningOnWindows && RepositoriesConfig.Repositories.HasAny(), so it's silently skipped on
Windows and only exercised on Linux/macOS.
-
core/Objects/CIFSClient.cs, constructor (lines 30-36) — the actual crash site:
public CIFSClient(Uri uri, ISMBClient smbClient = null)
{
var authStore = ExecutionContext.ServiceProvider.GetService<IRepositoryAuthStore>();
Server = uri.Host;
_smbClient = smbClient ?? new SMB2Client();
_credentials = authStore.GetCredentialsFor<CIFSRepositoryCredentials>(authStore.GetOrLoad().GetAwaiter().GetResult(), uri.AbsoluteUri);
// ^ NullReferenceException here when authStore has no entry at all for this repository
Summary
On any non-Windows platform, constructing any
BaseCommand-derived command crashes with anunhandled
NullReferenceExceptionif the repository'srepositories.jsonlists a UNC-stylerepository and no credentials have ever been saved for it via
cmf login. The crash happens duringCLI bootstrap/command-tree discovery — before any command's actual logic runs — so it breaks every
plugin command uniformly, not just the one the user is trying to run.
Where
core/Objects/ExecutionContext.cs, line 115 — the CIFS-connecting block is gated by!RunningOnWindows && RepositoriesConfig.Repositories.HasAny(), so it's silently skipped onWindows and only exercised on Linux/macOS.
core/Objects/CIFSClient.cs, constructor (lines 30-36) — the actual crash site: