Fixed repohook for annotation test

Bug: 245384734
Test: manual testing
Change-Id: I61e416dd12f5954002e55c0e205914575847ecf7
diff --git a/tools/GenericCarApiBuilder/annotation_classlist_repohook.py b/tools/GenericCarApiBuilder/annotation_classlist_repohook.py
index a19b108..d1a396c 100755
--- a/tools/GenericCarApiBuilder/annotation_classlist_repohook.py
+++ b/tools/GenericCarApiBuilder/annotation_classlist_repohook.py
@@ -17,6 +17,9 @@
 import subprocess
 
 rootDir = os.getenv("ANDROID_BUILD_TOP")
+if (rootDir is None):
+    print("\nANDROID_BUILD_TOP not set. Run source and lunch.\n")
+    sys.exit(1)
 
 # Generate class list using tool
 java_cmd = "java -jar " + rootDir + "/packages/services/Car/tools/GenericCarApiBuilder" \