Antiloveg 8 years ago
parent
commit
4404eff586

+ 6 - 2
src/main/java/com/goafanti/common/controller/PublicController.java

@@ -212,13 +212,17 @@ public class PublicController extends BaseController {
 			res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT));
 		} finally {
 			try {
-				in.close();
+				if (null != in) {
+					in.close();
+				}
 			} catch (IOException e) {
 				LoggerUtils.fmtError(getClass(), e, "IO错误:%s", e.getMessage());
 				res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT));
 			}
 			try {
-				out.close();
+				if (null != out) {
+					out.close();
+				}
 			} catch (IOException e) {
 				LoggerUtils.fmtError(getClass(), e, "IO错误:%s", e.getMessage());
 				res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT));