Fix a parameter incorrectly annotated NotNull
Bug: b.android.com/231574
Test: N/A
Change-Id: I616b96257ad343d822c09a04f77709392a72896f
(cherry picked from commit aa7f93cd7497988af23e81e4cf65bd5f021c005c)
diff --git a/src/com/google/appindexing/api/ApiCreator.java b/src/com/google/appindexing/api/ApiCreator.java
index 95490f3..7fc83cb 100644
--- a/src/com/google/appindexing/api/ApiCreator.java
+++ b/src/com/google/appindexing/api/ApiCreator.java
@@ -500,10 +500,15 @@
/**
* Check if the existing dependencies are enough to insert App Indexing code.
*
+ * @param module Supports null for convenience as some APIs return null modules. If null, this method aborts early.
+ *
* @return true if there are enough dependencies.
*/
// TODO: Consider to replace this method with DependencyStateManager.getPendingDependencies method, once it's refactored out from firebase module.
- static boolean hasEnoughDependencies(@NotNull Module module) {
+ static boolean hasEnoughDependencies(@Nullable Module module) {
+ if (module == null) {
+ return false;
+ }
final GradleBuildModel gradleBuildModel = GradleBuildModel.get(module);
// Possibly null in scenario such as gradle sync in progress.
if (gradleBuildModel == null) {