@@ -632,34 +632,36 @@ public void run() {
632632 final UserInfo userInfo = (UserInfo ) result .getData ().get (0 );
633633 final Quota quota = userInfo .getQuota ();
634634
635- final long used = quota .getUsed ();
636- final long total = quota .getTotal ();
637- final int relative = (int ) Math .ceil (quota .getRelative ());
638- final long quotaValue = quota .getQuota ();
639-
640- runOnUiThread (new Runnable () {
641- @ Override
642- public void run () {
643- if (quotaValue > 0
644- || quotaValue == GetRemoteUserInfoOperation .QUOTA_LIMIT_INFO_NOT_AVAILABLE ) {
645- /**
646- * show quota in case
647- * it is available and calculated (> 0) or
648- * in case of legacy servers (==QUOTA_LIMIT_INFO_NOT_AVAILABLE)
649- */
650- setQuotaInformation (used , total , relative );
651- } else {
652- /**
653- * quotaValue < 0 means special cases like
654- * {@link RemoteGetUserQuotaOperation.SPACE_NOT_COMPUTED},
655- * {@link RemoteGetUserQuotaOperation.SPACE_UNKNOWN} or
656- * {@link RemoteGetUserQuotaOperation.SPACE_UNLIMITED}
657- * thus don't display any quota information.
658- */
659- showQuota (false );
635+ if (quota != null ) {
636+ final long used = quota .getUsed ();
637+ final long total = quota .getTotal ();
638+ final int relative = (int ) Math .ceil (quota .getRelative ());
639+ final long quotaValue = quota .getQuota ();
640+
641+ runOnUiThread (new Runnable () {
642+ @ Override
643+ public void run () {
644+ if (quotaValue > 0
645+ || quotaValue == GetRemoteUserInfoOperation .QUOTA_LIMIT_INFO_NOT_AVAILABLE ) {
646+ /**
647+ * show quota in case
648+ * it is available and calculated (> 0) or
649+ * in case of legacy servers (==QUOTA_LIMIT_INFO_NOT_AVAILABLE)
650+ */
651+ setQuotaInformation (used , total , relative );
652+ } else {
653+ /**
654+ * quotaValue < 0 means special cases like
655+ * {@link RemoteGetUserQuotaOperation.SPACE_NOT_COMPUTED},
656+ * {@link RemoteGetUserQuotaOperation.SPACE_UNKNOWN} or
657+ * {@link RemoteGetUserQuotaOperation.SPACE_UNLIMITED}
658+ * thus don't display any quota information.
659+ */
660+ showQuota (false );
661+ }
660662 }
661- }
662- });
663+ });
664+ }
663665 }
664666 }
665667 });
0 commit comments