in library/src/main/java/com/whatsapp/stringpacks/StringPacks.java [90:110]
private Resources resolveResources(Context context) {
// It's first time set up from application, the base context passed in that has no application
// set to it yet.
if (context.getApplicationContext() != null) {
context = context.getApplicationContext();
}
Resources resources = context.getResources();
if (resources instanceof StringPackResources) {
resources = ((StringPackResources) resources).getBaseResources();
}
if (resources == null) {
throw new NullPointerException(
"Can't find resources from context. This could happen if it's set up in "
+ "Application#attachBaseContext(), where the application doesn't have base context."
+ " If that's the case, you can just pass in the base context.");
}
return resources;
}