···132132 // Compress by default, warn if if looks like an archive.
133133 match &input {
134134 CmprssInput::Path(path) => {
135135- if path.extension().unwrap() == compressor.extension() {
136136- return cmprss_error(
135135+ if let Some(ext) = path.extension() {
136136+ if ext == compressor.extension() {
137137+ return cmprss_error(
137138 &format!("error: input appears to already be a {} archive, exiting. Use '--compress' if needed.", compressor.name()));
139139+ }
138140 }
139141 compressor.compress(input, output)?;
140142 }