File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,9 @@ private function get_moodleoverflow_from_id($moodleoverflowid) {
100
100
public function check_access ($ id ) {
101
101
try {
102
102
$ post = moodleoverflow_get_post_full ($ id );
103
+ if (!$ post ) {
104
+ return \core_search \manager::ACCESS_DELETED ;
105
+ }
103
106
if (!$ discussion = $ this ->get_discussion_from_id ($ post ->discussion )) {
104
107
return \core_search \manager::ACCESS_DELETED ;
105
108
}
Original file line number Diff line number Diff line change @@ -473,7 +473,7 @@ function moodleoverflow_get_post_full($postid) {
473
473
$ params ['postid ' ] = $ postid ;
474
474
475
475
$ post = $ DB ->get_record_sql ($ sql , $ params );
476
- if ($ post ->userid === 0 ) {
476
+ if (isset ( $ post -> userid ) && $ post ->userid === 0 ) {
477
477
$ post ->message = get_string ('privacy:anonym_post_message ' , 'mod_moodleoverflow ' );
478
478
}
479
479
You can’t perform that action at this time.
0 commit comments