394. If any person, in committing or in attempting to commit robbery, voluntarily causes hurt, such person, and any other person jointly concerned in committing or attempting to commit such robbery, shall be punished with imprisonment for a term which may extend to twenty years, and shall also be liable to fine or to whipping.