Place 'sha' inside 'if pull' block.

This will guarantee that 'sha' will cause no errors:
If a pull is null, than sha will be referencing null.

Now that it's in the logic block, 'sha' will only be created if a pull
is found.