Fix possible dereference after null check

immutableSubstr might be null so we need to check for this condition.

FORWARD_NULL