Title: Group-Object fails with a NullReferenceException on empty noteproperty · Issue #3300 · PowerShell/PowerShell · GitHub
Open Graph Title: Group-Object fails with a NullReferenceException on empty noteproperty · Issue #3300 · PowerShell/PowerShell
X Title: Group-Object fails with a NullReferenceException on empty noteproperty · Issue #3300 · PowerShell/PowerShell
Description: Repro: PS C:\Users\slee> $x = 1 | Select-Object -Property @{Name = 'X'; Expression = {}} PS C:\Users\slee> $x | Group-Object X Expected Count Name Group ----- ---- ----- 1 {@{X=}} Actual Group-Object : Object reference not set to an inst...
Open Graph Description: Repro: PS C:\Users\slee> $x = 1 | Select-Object -Property @{Name = 'X'; Expression = {}} PS C:\Users\slee> $x | Group-Object X Expected Count Name Group ----- ---- ----- 1 {@{X=}} Actual Group-Obje...
X Description: Repro: PS C:\Users\slee> $x = 1 | Select-Object -Property @{Name = 'X'; Expression = {}} PS C:\Users\slee> $x | Group-Object X Expected Count Name Group ----- ---- ----- 1 {@{X=}} Act...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/3300
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Group-Object fails with a NullReferenceException on empty noteproperty ","articleBody":"Repro:\r\n\r\n```powershell\r\nPS C:\\Users\\slee> $x = 1 | Select-Object -Property @{Name = 'X'; Expression = {}}\r\nPS C:\\Users\\slee> $x | Group-Object X\r\n```\r\n\r\nExpected\r\n```powershell\r\nCount Name Group\r\n----- ---- -----\r\n 1 {@{X=}}\r\n```\r\n\r\nActual\r\n```powershell\r\nGroup-Object : Object reference not set to an instance of an object.\r\nAt line:1 char:6\r\n+ $x | Group-Object X\r\n+ ~~~~~~~~~~~~~~\r\n + CategoryInfo : NotSpecified: (:) [Group-Object], NullReferenceException\r\n + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.GroupObjectCommand\r\n```\r\n\r\nWorkaround\r\n```powershell\r\nPS C:\\Users\\slee> $x = 1 | Select-Object -Property @{Name = 'X'; Expression = {$null}}\r\nPS C:\\Users\\slee> $x | Group-Object X\r\n\r\nCount Name Group\r\n----- ---- -----\r\n 1 {@{X=}}\r\n```\r\n\r\nTFS:10939589\r\n\r\nPSVersionTable\r\n```powershell\r\nPS C:\\Users\\slee> $psversiontable\r\n\r\nName Value\r\n---- -----\r\nGitCommitId v6.0.0-alpha.17\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}\r\nCLRVersion\r\nSerializationVersion 1.1.0.1\r\nPSEdition Core\r\nBuildVersion 3.0.0.0\r\nPSVersion 6.0.0-alpha\r\nWSManStackVersion 3.0\r\nPSRemotingProtocolVersion 2.3\r\n```","author":{"url":"https://github.com/SteveL-MSFT","@type":"Person","name":"SteveL-MSFT"},"datePublished":"2017-03-10T18:24:19Z","url":"https://github.com/PowerShell/PowerShell/issues/3300"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4c6aa766-8449-8084-7d19-7afcd439441b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8DF2:7EDFD:2617DC:354C5F:6AFD72D8 |
| html-safe-nonce | d4e265e26ced9b30521410f47556ea83ef2ff39cbbe3f724e42a83a3802797d0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4REYyOjdFREZEOjI2MTdEQzozNTRDNUY6NkFGRDcyRDgiLCJ2aXNpdG9yX2lkIjoiMzMzMzYzNjA2Nzk5MDI3MDY4MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 07f04edefb85ac08cdc92eca2b5826bb39da5752476bf3f5a73f9d23543e854c |
| hovercard-subject-tag | issue:213415568 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/3300/issue_layout |
| twitter:image | https://opengraph.githubassets.com/02a879f025b4e30a6c189ba498aab1f01534c4f40a4bae52d443a4313c043fbf/PowerShell/PowerShell/issues/3300 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/02a879f025b4e30a6c189ba498aab1f01534c4f40a4bae52d443a4313c043fbf/PowerShell/PowerShell/issues/3300 |
| og:image:alt | Repro: PS C:\Users\slee> $x = 1 | Select-Object -Property @{Name = 'X'; Expression = {}} PS C:\Users\slee> $x | Group-Object X Expected Count Name Group ----- ---- ----- 1 {@{X=}} Actual Group-Obje... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SteveL-MSFT |
| hostname | github.com |
| expected-hostname | github.com |
| None | e54006cf2b96d1ac260960edd10003132911469ccd1ec99c9803119fe2a4e032 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5be0bf2b8cf26f8897d31e6bc3c232d328b12a54 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width