- } else if ($name == 'shownotice') {
- $notice = $action->profile;
- if (!empty($notice) && !empty($notice->lat) && !empty($notice->lon)) {
+ } elseif ($action instanceof ShownoticeAction) {
+ // FIXME: getNotice in ShownoticeAction will do a new lookup, we should fix those classes
+ // so they can reliably just get a pre-stored notice object which was fetched in Shownotice prepare()...
+ $notice = $action->notice;
+ if ($notice instanceof Notice && !empty($notice->lat) && !empty($notice->lon)) {