Fix NPE in JobPackageTracker

Issue #30229662  UI server crash

Change-Id: I1487824c8c8aee857446f9607906081e7541eaf6
diff --git a/services/core/java/com/android/server/job/JobPackageTracker.java b/services/core/java/com/android/server/job/JobPackageTracker.java
index ba96b74..82e2eb4 100644
--- a/services/core/java/com/android/server/job/JobPackageTracker.java
+++ b/services/core/java/com/android/server/job/JobPackageTracker.java
@@ -395,7 +395,10 @@
             return 0;
         }
         final long now = SystemClock.uptimeMillis();
-        long time = cur.getActiveTime(now) + cur.getPendingTime(now);
+        long time = 0;
+        if (cur != null) {
+            time += cur.getActiveTime(now) + cur.getPendingTime(now);
+        }
         long period = mCurDataSet.getTotalTime(now);
         if (last != null) {
             time += last.getActiveTime(now) + last.getPendingTime(now);