[Issue 17250] ProcessPipes (std.process) should provide a test for a null pid

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jul 17 03:50:29 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17250

--- Comment #4 from Vladimir Panteleev <dlang-bugzilla at thecybershadow.net> ---
(In reply to Jon Degenhardt from comment #1)
> The problem is that there is no method available to determine if pid is null
> prior to call the pid() method.

Why not: if (pipes !is ProcessPipes.init)

(In reply to RazvanN from comment #2)
> I think the solution here is to remove the assert and expect the user to
> check if the result of pid is null.

I think that's OK too, though it has the small downside that null dereferencing
bugs are harder to diagnose on non-Windows systems.

We could also add an implicit conversion to bool.

--


More information about the Digitalmars-d-bugs mailing list