Skip to content

Commit

Permalink
Remove NullPointerException
Browse files Browse the repository at this point in the history
  • Loading branch information
bueltge committed Dec 14, 2017
1 parent 61e4b31 commit 4512a6d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions must_use_loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ public function delete_subdir_mu_plugin_cache() {

// get screen information
$screen = get_current_screen();
if ( null === $screen ) {
return;
}

// Delete cache when viewing plugins page in /wp-admin/
if ( 'plugins-network' === $screen->id ) {
Expand All @@ -287,17 +290,17 @@ public function delete_subdir_mu_plugin_cache() {
public function change_view_values() {

$current_screen = get_current_screen();
if ( 'plugins-network' !== $current_screen->id ) {
if ( null === $current_screen || 'plugins-network' !== $current_screen->id ) {
return;
}

$item = sprintf( _n( 'item', 'items', $this->mustuse_total ), number_format_i18n( $this->mustuse_total ) ); ?>
<script type="text/javascript">
( function( $ ) {
jQuery( document ).ready( function($) {
let text,
value,
mustuse,
selector;
value,
mustuse,
selector;

// replace the brackets and set int value
selector = '.mustuse span';
Expand All @@ -312,7 +315,7 @@ public function change_view_values() {
if ( document.URL.search( /plugin_status=mustuse/ ) !== - 1 ) {
$( '.tablenav .displaying-num' ).replaceWith( mustuse );
}
}( jQuery );
} );
</script>
<?php
}
Expand Down

0 comments on commit 4512a6d

Please sign in to comment.