@@ -1107,7 +1107,7 @@ pub fn handle_settle_pnl<'c: 'info, 'info>(
11071107 )
11081108 . map ( |_| ErrorCode :: InvalidOracleForSettlePnl ) ?;
11091109
1110- let res = controller:: pnl:: settle_pnl (
1110+ controller:: pnl:: settle_pnl (
11111111 market_index,
11121112 user,
11131113 ctx. accounts . authority . key ,
@@ -1119,14 +1119,7 @@ pub fn handle_settle_pnl<'c: 'info, 'info>(
11191119 state,
11201120 None ,
11211121 SettlePnlMode :: MustSettle ,
1122- ) ;
1123- if let Err ( e) = res {
1124- if e != ErrorCode :: UserHasNoPositionInMarket {
1125- return Err ( e. into ( ) ) ;
1126- } else {
1127- msg ! ( "User has no position in market {}" , market_index) ;
1128- }
1129- }
1122+ ) ?;
11301123 }
11311124
11321125 if state. builder_codes_enabled ( ) || state. builder_referral_enabled ( ) {
@@ -1229,7 +1222,7 @@ pub fn handle_settle_multiple_pnls<'c: 'info, 'info>(
12291222 )
12301223 . map ( |_| ErrorCode :: InvalidOracleForSettlePnl ) ?;
12311224
1232- let res = controller:: pnl:: settle_pnl (
1225+ controller:: pnl:: settle_pnl (
12331226 * market_index,
12341227 user,
12351228 ctx. accounts . authority . key ,
@@ -1241,14 +1234,7 @@ pub fn handle_settle_multiple_pnls<'c: 'info, 'info>(
12411234 state,
12421235 Some ( meets_margin_requirement) ,
12431236 mode,
1244- ) ;
1245- if let Err ( e) = res {
1246- if e != ErrorCode :: UserHasNoPositionInMarket {
1247- return Err ( e. into ( ) ) ;
1248- } else {
1249- msg ! ( "User has no position in market {}" , market_index) ;
1250- }
1251- }
1237+ ) ?;
12521238 }
12531239
12541240 if state. builder_codes_enabled ( ) || state. builder_referral_enabled ( ) {
0 commit comments