Making WordPress.org

Changeset 2198


Ignore:
Timestamp:
12/17/2015 03:27:28 PM (9 years ago)
Author:
ocean90
Message:

Trac Notifications: Avoid a PHP notice if a component (like Administration) has no page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-components.php

    r2023 r2198  
    483483                printf( '<h3>%s (%d)</h3>', $title, count( $tickets ) );
    484484                echo $this->trac_query_link( 'View list on Trac', $args );
    485                 $this->render_tickets( $tickets ); 
     485                $this->render_tickets( $tickets );
    486486            }
    487487        }
     
    607607
    608608    function get_component_maintainers( $component ) {
    609         return $this->get_component_maintainers_by_post( get_page_by_title( $component, OBJECT, 'component' )->ID );
     609        $component_page = get_page_by_title( $component, OBJECT, 'component' );
     610        if ( $component_page ) {
     611            return $this->get_component_maintainers_by_post( $component_page->ID );
     612        } else {
     613            return array();
     614        }
    610615    }
    611616}
Note: See TracChangeset for help on using the changeset viewer.