Don't try to access runtime after determining it is null. Pull request by mduggan.