Fix a couple npes if the client isnt' loaded

This commit is contained in:
Adam
2017-04-21 22:35:31 -04:00
parent b8b962ec20
commit 345d197171
2 changed files with 16 additions and 8 deletions

View File

@@ -138,7 +138,13 @@ public class MenuManager
{ {
int index = IDX_LOWER; int index = IDX_LOWER;
String[] playerOptions = RuneLite.getClient().getPlayerOptions(); Client client = RuneLite.getClient();
if (client == null)
{
return IDX_UPPER;
}
String[] playerOptions = client.getPlayerOptions();
while (index < IDX_UPPER && playerOptions[index] != null) while (index < IDX_UPPER && playerOptions[index] != null)
{ {
index++; index++;

View File

@@ -22,7 +22,6 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
package net.runelite.client.ui; package net.runelite.client.ui;
import java.applet.Applet; import java.applet.Applet;
@@ -78,10 +77,13 @@ final class ClientPanel extends JPanel implements ComponentListener
@Override @Override
public void componentResized(ComponentEvent e) public void componentResized(ComponentEvent e)
{ {
rs.setLocation(0, 0); if (rs != null)
rs.setSize(this.getSize()); {
rs.setLocation(0, 0);
rs.setSize(this.getSize());
rs.setPreferredSize(this.getPreferredSize());
}
this.setPreferredSize(this.getSize()); this.setPreferredSize(this.getSize());
rs.setPreferredSize(this.getPreferredSize());
} }
@Override @Override