Germany had a policy of unrestricted submarine warfare. That meant that whoever was in the seas, regardless of whether they were civilians, military, uninvolved in the war or enemies, everyone was fair game and would be torpedoed. This is for example why Lusitania was sunk even though it was a civil ship.