Such nonconforming building or structure shall not be structurally altered or reconstructed unless such alterations are required by law; provided, however, that such maintenance and repair work as is required to keep a nonconforming building or structure in safe condition shall be permitted.