Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState) wouldnt cause a NPE while Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED) does cause NPE and crashes the application.
I still dont know why getExternalStorageState is null eventhough I have permissions set but the solutions atleast wouldn't crash the application.