From 46fa5b84178091350648391a6c3182f90159d49b Mon Sep 17 00:00:00 2001 From: ShamazinGG Date: Fri, 8 Dec 2023 22:54:34 +0300 Subject: [PATCH] fix extractState when state is null --- src/Screen/Screen.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Screen/Screen.php b/src/Screen/Screen.php index e9088dbc9..beb8603cb 100644 --- a/src/Screen/Screen.php +++ b/src/Screen/Screen.php @@ -188,16 +188,15 @@ public function asyncParticalLayout(Layout $layout, Request $request) */ protected function extractState(): Repository { + $state = request()->post('_state', session()->get('_state')); // Check if the '_state' parameter is missing - if (! request()->request->has('_state') && session()->missing('_state')) { + if ($state === null) { // Return an empty Repository object return new Repository(); } - // Extract the encrypted state from the '_state' parameter, and deserialize it - $raw = request()->post('_state') ?? session()->get('_state'); - - return Crypt::decrypt($raw); + //deserialize '_state' parameter + return Crypt::decrypt($state); } /**