diff --git a/src/lib-sieve/storage/file/sieve-file-storage-save.c b/src/lib-sieve/storage/file/sieve-file-storage-save.c
index 55aa71cbf1f95385fc2a5bf083859d376be68888..fbd5a133c8c0df37367c8cb6baa9255dd94d8589 100644
--- a/src/lib-sieve/storage/file/sieve-file-storage-save.c
+++ b/src/lib-sieve/storage/file/sieve-file-storage-save.c
@@ -231,8 +231,8 @@ int sieve_file_storage_save_continue
 
 	switch (o_stream_send_istream(fsctx->output, sctx->input)) {
 	case OSTREAM_SEND_ISTREAM_RESULT_FINISHED:
-		return 0;
 	case OSTREAM_SEND_ISTREAM_RESULT_WAIT_INPUT:
+		return 0;
 	case OSTREAM_SEND_ISTREAM_RESULT_WAIT_OUTPUT:
 		i_unreached();
 	case OSTREAM_SEND_ISTREAM_RESULT_ERROR_INPUT: