Skip to content

Commit

Permalink
catch the case where a user doesn't have a default project set... thi…
Browse files Browse the repository at this point in the history
…s shouldn't happen but may happen with old DB data

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@1604 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Julian Fitzell committed Nov 10, 2002
1 parent c1acea7 commit 7529133
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/helper_api.php
Expand Up @@ -6,7 +6,7 @@
# See the files README and LICENSE for details

# --------------------------------------------------------
# $Id: helper_api.php,v 1.21 2002-10-23 02:18:10 jfitzell Exp $
# $Id: helper_api.php,v 1.22 2002-11-10 21:38:22 jfitzell Exp $
# --------------------------------------------------------

###########################################################################
Expand Down Expand Up @@ -201,7 +201,11 @@ function helper_get_current_project() {
$t_project_id = gpc_get_cookie( $t_cookie_name, null );

if ( null === $t_project_id ) {
return (int)current_user_get_pref( 'default_project' );
$t_pref = current_user_get_pref( 'default_project' );
if ( '' == $t_pref ) {
$t_pref = 0;
}
return (int)$t_pref;
} else {
return (int)$t_project_id;
}
Expand Down

0 comments on commit 7529133

Please sign in to comment.