Skip to content

Commit

Permalink
Build a default filter only when needed
Browse files Browse the repository at this point in the history
Check returned value and build a default filter only when needed.
  • Loading branch information
cproensa authored and atrol committed Mar 4, 2018
1 parent 820d6ca commit b55c7e1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/current_user_api.php
Expand Up @@ -239,7 +239,11 @@ function current_user_get_bug_filter( $p_project_id = null ) {
$f_tmp_key = gpc_get_string( 'filter', null );

if( null !== $f_tmp_key ) {
$t_filter = filter_temporary_get( $f_tmp_key, filter_get_default() );
$t_filter = filter_temporary_get( $f_tmp_key, null );
# if filter doesn't exist or can't be loaded, return a default filter (doesn't throw error)
if( null === $t_filter ) {
$t_filter = filter_get_default();
}
} else {
$t_user_id = auth_get_current_user_id();
$t_filter = user_get_bug_filter( $t_user_id, $p_project_id );
Expand Down

0 comments on commit b55c7e1

Please sign in to comment.