Skip to content

Commit

Permalink
Added is_array check before using count to prevent warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddharth Tikekar committed Apr 7, 2020
1 parent da7c736 commit d21b3ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/main/routers/query/RTMediaQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function set_media_type() {
if ( ! isset( $this->query['media_type'] ) ) {
if ( isset( $this->action_query->id ) ) {
$media = $this->model->get( array( 'id' => $this->action_query->id ) );
if ( count( $media ) > 0 ) {
if ( is_array( $media ) && count( $media ) > 0 ) {
$media_type = $media[0]->media_type;
$this->query['media_type'] = $media_type;
}
Expand Down

0 comments on commit d21b3ca

Please sign in to comment.