This is a Jimmy Wakely story from Jimmy Wakely #9 (January-February 1951) with the main character retouched to become Hopalong Cassidy.