To avoid having to do the null check, you can do the `context = ...` before the try block. If that were to throw an exception, then the variable would never be set so nothing to close (so doesn't need to be in the try-catch).
But don't worry about it for this PR.