I just downloaded and installed the newest MT code. First time I've ever used MT, or any blog-type software; however I am a Perl coder of many years.

I am receiving many "Can't call method on undefined value" errors from various places. I basically logged in with the default user, deleted the default web log, then attempted to modify my user information. Upon saving I receive the error (I've also received it while trying to rebuild a new web log).

The problem is that MT::Blog->load() can return 'undef', yet at line 1360 of MT::App::CMS, for instance, this state is never checked. The code assumes an object is returned and results in the error.

I am sure this is the case in the other instances I have received the error.

For the MT::App::CMS (line 1360) instance, I simply changed:

my $blog = MT::Blog->load($obj->blog_id);

to

if (my $blog = MT::Blog->load($obj->blog_id)){

}

Problem with this is I don't know if the code following that point must be called or not (it seemed to have saved my profile so I assume it doesn't matter, but the code jumps all over the place so it's hard to follow).