Changeset 1cc95709 for perlconfig.c


Ignore:
Timestamp:
Feb 19, 2007, 7:05:36 PM (14 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
be5aa09
Parents:
186cdc4
git-author:
Nelson Elhage <nelhage@mit.edu> (02/19/07 19:05:23)
git-committer:
Nelson Elhage <nelhage@mit.edu> (02/19/07 19:05:36)
Message:
Don't segfault if we encounter a message type without a corresponding
perl class.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlconfig.c

    rb6c067a r1cc95709  
    2828SV *owl_perlconfig_message2hashref(owl_message *m)
    2929{
    30   HV *h;
     30  HV *h, *stash;
    3131  SV *hr;
    3232  char *ptr, *blessas, *type;
     
    9393
    9494  hr = sv_2mortal(newRV_noinc((SV*)h));
    95   hr = sv_bless(hr, gv_stashpv(blessas,0));
     95  stash =  gv_stashpv(blessas,0);
     96  if(!stash) {
     97    owl_function_error("No such class: %s for message type %s", blessas, owl_message_get_type(m));
     98    stash = gv_stashpv("BarnOwl::Message", 1);
     99  }
     100  hr = sv_bless(hr,stash);
    96101  owl_free(type);
    97102  owl_free(blessas);
Note: See TracChangeset for help on using the changeset viewer.