PratMis: Will add a small test for it
diff --git a/c7n/resources/asg.py b/c7n/resources/asg.py
index dfefff94d..9d01ee426 100644
--- a/c7n/resources/asg.py
+++ b/c7n/resources/asg.py
@@ -574,6 +574,8 @@ class ImageAgeFilter(AgeFilter):
 
     def get_resource_date(self, asg):
         cfg = self.launch_info.get(asg)
+        if cfg is None:
+            cfg = {}
         ami = self.images.get(cfg.get('ImageId'), {})
         return parse(ami.get(
             self.date_attribute, "2000-01-01T01:01:01.000Z"))

aws - asg.image-age filter fails 
**Describe the bug**
A policy that filters asg based off the image-age is failing  

**To Reproduce**
Dry run the policy shown below

**Expected behavior**
Should execute the policy completely

**Background (please complete the following information):**

 - Python Version: 3.7
 - Custodian Version: 0.9.1
 - Tool Version: [if applicable]
 - Cloud Provider: aws
 - Policy: [please exclude any account/sensitive information]
```yaml
 - name: asg-ami
   resource: asg
    filters:
      - "tag:custodian": not-null
      - or:
        - type: image-age
          op: lt
          days: x
```
 - Traceback: [if applicable, please exclude sensitive/account information]
```
custodian run --dryrun --profile abc asg-ami.yml --region us-east-1 -s asg-ami --cache-period 0 -v
2020-05-11 16:26:37,495: custodian.cache:DEBUG Disabling cache
2020-05-11 16:26:37,496: custodian.commands:DEBUG Loaded file asg-ami.yml. Contains 1 policies
2020-05-11 16:26:38,023: custodian.output:DEBUG Storing output with <LogFile asg-ami/custodian-run.log>
2020-05-11 16:26:38,165: custodian.policy:DEBUG Running policy:asg-ami
resource:asg region:us-east-1 c7n:0.9.1
2020-05-11 16:26:51,425: custodian.resources.launchconfig:DEBUG Filtered from 527 to 527 launchconfig
2020-05-11 16:26:51,683: custodian.output:DEBUG metric:PolicyException Count:1 policy:asg-ami
restype:asg
2020-05-11 16:26:51,683: custodian.output:DEBUG metric:ApiCalls Count:28 policy:asg-ami
restype:asg
2020-05-11 16:26:51,683: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
  File "/Users/abc/custodian/cloud-custodian/c7n/policy.py", line 291, in run
    resources = self.policy.resource_manager.resources()
  File "/Users/abc/custodian/cloud-custodian/c7n/query.py", line 465, in resources
    resources = self.filter_resources(resources)
  File "/Users/abc/custodian/cloud-custodian/c7n/manager.py", line 109, in filter_resources
    resources = f.process(resources, event)
  File "/Users/abc/custodian/cloud-custodian/c7n/filters/core.py", line 258, in process
    return self.process_set(resources, event)
  File "/Users/abc/custodian/cloud-custodian/c7n/filters/core.py", line 274, in process_set
    r[rtype_id] for r in f.process(resources, event)])
  File "/Users/abc/custodian/cloud-custodian/c7n/resources/asg.py", line 573, in process
    return super(ImageAgeFilter, self).process(asgs, event)
  File "/Users/abc/custodian/cloud-custodian/c7n/filters/core.py", line 197, in process
    return list(filter(self, resources))
  File "/Users/abc/custodian/cloud-custodian/c7n/filters/core.py", line 677, in __call__
    v = self.get_resource_date(i)
  File "/Users/abc/custodian/cloud-custodian/c7n/resources/asg.py", line 577, in get_resource_date
    ami = self.images.get(cfg.get('ImageId'), {})
AttributeError: 'NoneType' object has no attribute 'get'
2020-05-11 16:26:51,688: custodian.commands:ERROR Error while executing policy asg-ami, continuing
Traceback (most recent call last):
  File "/Users/abc/custodian/cloud-custodian/c7n/commands.py", line 281, in run
    policy()
  File "/Users/abc/custodian/cloud-custodian/c7n/policy.py", line 1031, in __call__
    resources = PullMode(self).run()
  File "/Users/abc/custodian/cloud-custodian/c7n/policy.py", line 291, in run
    resources = self.policy.resource_manager.resources()
  File "/Users/abc/custodian/cloud-custodian/c7n/query.py", line 465, in resources
    resources = self.filter_resources(resources)
  File "/Users/abc/custodian/cloud-custodian/c7n/manager.py", line 109, in filter_resources
    resources = f.process(resources, event)
  File "/Users/abc/custodian/cloud-custodian/c7n/filters/core.py", line 258, in process
    return self.process_set(resources, event)
  File "/Users/abc/custodian/cloud-custodian/c7n/filters/core.py", line 274, in process_set
    r[rtype_id] for r in f.process(resources, event)])
  File "/Users/abc/custodian/cloud-custodian/c7n/resources/asg.py", line 573, in process
    return super(ImageAgeFilter, self).process(asgs, event)
  File "/Users/abc/custodian/cloud-custodian/c7n/filters/core.py", line 197, in process
    return list(filter(self, resources))
  File "/Users/abc/custodian/cloud-custodian/c7n/filters/core.py", line 677, in __call__
    v = self.get_resource_date(i)
  File "/Users/abc/custodian/cloud-custodian/c7n/resources/asg.py", line 577, in get_resource_date
    ami = self.images.get(cfg.get('ImageId'), {})
AttributeError: 'NoneType' object has no attribute 'get'
```
 - `custodian version --debug` output

**Additional context**
Add any other context about the problem here.

diff --git a/tests/data/placebo/test_asg_image_age_filter_deleted_config/autoscaling.DescribeAutoScalingGroups_1.json b/tests/data/placebo/test_asg_image_age_filter_deleted_config/autoscaling.DescribeAutoScalingGroups_1.json
new file mode 100644
index 000000000..7a03850fa
--- /dev/null
+++ b/tests/data/placebo/test_asg_image_age_filter_deleted_config/autoscaling.DescribeAutoScalingGroups_1.json
@@ -0,0 +1,100 @@
+{
+    "status_code": 200,
+    "data": {
+        "AutoScalingGroups": [
+            {
+                "AutoScalingGroupName": "devx",
+                "AutoScalingGroupARN": "arn:aws:autoscaling:us-east-1:644160558196:autoScalingGroup:94c763b0-e6ce-49ee-a7e9-d014090fad73:autoScalingGroupName/devx",
+                "MixedInstancesPolicy": {
+                    "LaunchTemplate": {
+                        "LaunchTemplateSpecification": {
+                            "LaunchTemplateId": "lt-0877401c93c294001",
+                            "LaunchTemplateName": "test",
+                            "Version": "4"
+                        },
+                        "Overrides": [
+                            {
+                                "InstanceType": "t3.medium"
+                            }
+                        ]
+                    },
+                    "InstancesDistribution": {
+                        "OnDemandAllocationStrategy": "prioritized",
+                        "OnDemandBaseCapacity": 1,
+                        "OnDemandPercentageAboveBaseCapacity": 0,
+                        "SpotAllocationStrategy": "capacity-optimized"
+                    }
+                },
+                "MinSize": 0,
+                "MaxSize": 2,
+                "DesiredCapacity": 1,
+                "DefaultCooldown": 300,
+                "AvailabilityZones": [
+                    "us-east-1d",
+                    "us-east-1e"
+                ],
+                "LoadBalancerNames": [],
+                "TargetGroupARNs": [],
+                "HealthCheckType": "EC2",
+                "HealthCheckGracePeriod": 300,
+                "Instances": [
+                    {
+                        "InstanceId": "i-04e252315a3b7940a",
+                        "InstanceType": "t1.micro",
+                        "AvailabilityZone": "us-east-1d",
+                        "LifecycleState": "InService",
+                        "HealthStatus": "Healthy",
+                        "LaunchTemplate": {
+                            "LaunchTemplateId": "lt-0877401c93c294001",
+                            "LaunchTemplateName": "test",
+                            "Version": "4"
+                        },
+                        "ProtectedFromScaleIn": false
+                    }
+                ],
+                "CreatedTime": {
+                    "__class__": "datetime",
+                    "year": 2019,
+                    "month": 10,
+                    "day": 29,
+                    "hour": 14,
+                    "minute": 37,
+                    "second": 33,
+                    "microsecond": 482000
+                },
+                "SuspendedProcesses": [],
+                "VPCZoneIdentifier": "subnet-3a334610,subnet-e3b194de",
+                "EnabledMetrics": [],
+                "Tags": [
+                    {
+                        "ResourceId": "devx",
+                        "ResourceType": "auto-scaling-group",
+                        "Key": "Creator",
+                        "Value": "xyz@gmail.com",
+                        "PropagateAtLaunch": false
+                    },
+                    {
+                        "ResourceId": "devx",
+                        "ResourceType": "auto-scaling-group",
+                        "Key": "Env",
+                        "Value": "App",
+                        "PropagateAtLaunch": true
+                    },
+                    {
+                        "ResourceId": "devx",
+                        "ResourceType": "auto-scaling-group",
+                        "Key": "Owner",
+                        "Value": "test",
+                        "PropagateAtLaunch": true
+                    }
+                ],
+                "TerminationPolicies": [
+                    "Default"
+                ],
+                "NewInstancesProtectedFromScaleIn": false,
+                "ServiceLinkedRoleARN": "arn:aws:iam::644160558196:role/aws-service-role/autoscaling.amazonaws.com/AWSServiceRoleForAutoScaling"
+            }
+        ],
+        "ResponseMetadata": {}
+    }
+}
\ No newline at end of file
diff --git a/tests/data/placebo/test_asg_image_age_filter_deleted_config/ec2.DescribeLaunchTemplateVersions_1.json b/tests/data/placebo/test_asg_image_age_filter_deleted_config/ec2.DescribeLaunchTemplateVersions_1.json
new file mode 100644
index 000000000..178f48a5a
--- /dev/null
+++ b/tests/data/placebo/test_asg_image_age_filter_deleted_config/ec2.DescribeLaunchTemplateVersions_1.json
@@ -0,0 +1,10 @@
+{
+    "status_code": 400,
+    "data": {
+        "Error": {
+            "Code": "InvalidLaunchTemplateId.NotFound",
+            "Message": "The specified launch template, with template ID lt-0877401c93c294001, does not exist."
+        },
+        "ResponseMetadata": {}
+    }
+}
\ No newline at end of file
diff --git a/tests/test_asg.py b/tests/test_asg.py
index 08c5a5bfe..a4b7d75b5 100644
--- a/tests/test_asg.py
+++ b/tests/test_asg.py
@@ -199,6 +199,22 @@ class AutoScalingTest(BaseTest):
         resources = p.run()
         self.assertEqual(len(resources), 1)
 
+    def test_asg_image_age_filter_deleted_config(self):
+        factory = self.replay_flight_data("test_asg_image_age_filter_deleted_config")
+        p = self.load_policy(
+            {
+                "name": "asg-image-age-filter",
+                "resource": "asg",
+                "filters": [
+                    {"tag:Env": "present"},
+                    {"type": "image-age", "days": 5000, "op": "gt"}],
+            },
+            session_factory=factory,
+        )
+        resources = p.run()
+        self.assertEqual(len(resources), 1)
+        self.assertTrue('Env' in resources[0].get('Tags')[1].values())
+
     def test_asg_config_filter(self):
         factory = self.replay_flight_data("test_asg_config_filter")
         p = self.load_policy(

pip install -e .
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio
apt-get update apt-get install -y gcc
3.8
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
apipkg==1.5
appdirs==1.4.3
argcomplete==1.11.1
attrs==19.3.0
aws-xray-sdk==2.5.0
bleach==3.1.5
boto3==1.13.2
botocore==1.16.2
-e git+https://github.com/cloud-custodian/cloud-custodian.git@9f443bf62db693dd0a19f49e0b4f4efb452ca903#egg=c7n
certifi==2020.4.5.1
cffi==1.14.0
chardet==3.0.4
coverage==5.1
cryptography==2.9.2
distlib==0.3.0
docutils==0.15.2
entrypoints==0.3
exceptiongroup==1.2.2
execnet==1.7.1
filelock==3.0.12
flake8==3.7.9
future==0.18.2
idna==2.9
importlib-metadata==1.6.0
iniconfig==2.1.0
jeepney==0.4.3
jmespath==0.9.5
jsonpatch==1.25
jsonpickle==1.4.1
jsonpointer==2.0
jsonschema==3.2.0
keyring==21.2.1
mccabe==0.6.1
mock==4.0.2
more-itertools==8.2.0
multidict==4.7.5
packaging==20.3
pkginfo==1.5.0.1
placebo==0.9.0
pluggy==1.5.0
psutil==5.7.0
py==1.8.1
pycodestyle==2.5.0
pycparser==2.20
pyflakes==2.1.1
Pygments==2.6.1
pyparsing==2.4.7
pyrsistent==0.16.0
pytest==8.3.5
pytest-asyncio==0.24.0
pytest-cov==2.8.1
pytest-forked==1.1.3
pytest-mock==3.14.0
pytest-sugar==0.9.3
pytest-xdist==1.32.0
python-dateutil==2.8.1
PyYAML==5.3.1
readme-renderer==26.0
requests==2.23.0
requests-toolbelt==0.9.1
s3transfer==0.3.3
SecretStorage==3.1.2
six==1.14.0
tabulate==0.8.7
termcolor==1.1.0
toml==0.10.0
tomli==2.2.1
tox==3.15.0
tqdm==4.46.0
twine==3.1.1
urllib3==1.25.9
vcrpy==4.0.2
virtualenv==20.0.20
wcwidth==0.1.9
webencodings==0.5.1
wrapt==1.12.1
yarl==1.4.2
zipp==3.1.0

name: cloud-custodian
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=24.2=py38h06a4308_0
  - python=3.8.20=he870216_0
  - readline=8.2=h5eee18b_0
  - setuptools=75.1.0=py38h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.44.0=py38h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - apipkg==1.5
      - appdirs==1.4.3
      - argcomplete==1.11.1
      - attrs==19.3.0
      - aws-xray-sdk==2.5.0
      - bleach==3.1.5
      - boto3==1.13.2
      - botocore==1.16.2
      - c7n==0.9.1
      - certifi==2020.4.5.1
      - cffi==1.14.0
      - chardet==3.0.4
      - coverage==5.1
      - cryptography==2.9.2
      - distlib==0.3.0
      - docutils==0.15.2
      - entrypoints==0.3
      - exceptiongroup==1.2.2
      - execnet==1.7.1
      - filelock==3.0.12
      - flake8==3.7.9
      - future==0.18.2
      - idna==2.9
      - importlib-metadata==1.6.0
      - iniconfig==2.1.0
      - jeepney==0.4.3
      - jmespath==0.9.5
      - jsonpatch==1.25
      - jsonpickle==1.4.1
      - jsonpointer==2.0
      - jsonschema==3.2.0
      - keyring==21.2.1
      - mccabe==0.6.1
      - mock==4.0.2
      - more-itertools==8.2.0
      - multidict==4.7.5
      - packaging==20.3
      - pkginfo==1.5.0.1
      - placebo==0.9.0
      - pluggy==1.5.0
      - psutil==5.7.0
      - py==1.8.1
      - pycodestyle==2.5.0
      - pycparser==2.20
      - pyflakes==2.1.1
      - pygments==2.6.1
      - pyparsing==2.4.7
      - pyrsistent==0.16.0
      - pytest==8.3.5
      - pytest-asyncio==0.24.0
      - pytest-cov==2.8.1
      - pytest-forked==1.1.3
      - pytest-mock==3.14.0
      - pytest-sugar==0.9.3
      - pytest-xdist==1.32.0
      - python-dateutil==2.8.1
      - pyyaml==5.3.1
      - readme-renderer==26.0
      - requests==2.23.0
      - requests-toolbelt==0.9.1
      - s3transfer==0.3.3
      - secretstorage==3.1.2
      - six==1.14.0
      - tabulate==0.8.7
      - termcolor==1.1.0
      - toml==0.10.0
      - tomli==2.2.1
      - tox==3.15.0
      - tqdm==4.46.0
      - twine==3.1.1
      - urllib3==1.25.9
      - vcrpy==4.0.2
      - virtualenv==20.0.20
      - wcwidth==0.1.9
      - webencodings==0.5.1
      - wrapt==1.12.1
      - yarl==1.4.2
      - zipp==3.1.0
prefix: /opt/conda/envs/cloud-custodian

tests/test_asg.py::AutoScalingTest::test_asg_image_age_filter_deleted_config
tests/test_asg.py::LaunchConfigTest::test_config_delete tests/test_asg.py::LaunchConfigTest::test_config_unused tests/test_asg.py::TestUserData::test_regex_filter tests/test_asg.py::AutoScalingTemplateTest::test_asg_mixed_instance_templates tests/test_asg.py::AutoScalingTest::test_asg_config_filter tests/test_asg.py::AutoScalingTest::test_asg_delete tests/test_asg.py::AutoScalingTest::test_asg_filter_capacity_delta_match tests/test_asg.py::AutoScalingTest::test_asg_filter_capacity_delta_nomatch tests/test_asg.py::AutoScalingTest::test_asg_image_age_filter tests/test_asg.py::AutoScalingTest::test_asg_image_age_filter_template tests/test_asg.py::AutoScalingTest::test_asg_invalid_filter_bad tests/test_asg.py::AutoScalingTest::test_asg_invalid_filter_good tests/test_asg.py::AutoScalingTest::test_asg_mark_for_op tests/test_asg.py::AutoScalingTest::test_asg_mark_for_op_hours tests/test_asg.py::AutoScalingTest::test_asg_marked_for_op_hours tests/test_asg.py::AutoScalingTest::test_asg_non_encrypted_filter tests/test_asg.py::AutoScalingTest::test_asg_non_encrypted_filter_with_templates tests/test_asg.py::AutoScalingTest::test_asg_not_propagate_tag_match tests/test_asg.py::AutoScalingTest::test_asg_not_propagate_tag_missing tests/test_asg.py::AutoScalingTest::test_asg_propagate_tag_filter tests/test_asg.py::AutoScalingTest::test_asg_propagate_tag_missing tests/test_asg.py::AutoScalingTest::test_asg_remove_tag tests/test_asg.py::AutoScalingTest::test_asg_rename_tag tests/test_asg.py::AutoScalingTest::test_asg_resize_restore_from_tag tests/test_asg.py::AutoScalingTest::test_asg_resize_save_to_tag tests/test_asg.py::AutoScalingTest::test_asg_resize_to_current tests/test_asg.py::AutoScalingTest::test_asg_resume tests/test_asg.py::AutoScalingTest::test_asg_security_group tests/test_asg.py::AutoScalingTest::test_asg_security_group_not_matched tests/test_asg.py::AutoScalingTest::test_asg_subnet tests/test_asg.py::AutoScalingTest::test_asg_suspend tests/test_asg.py::AutoScalingTest::test_asg_suspend_when_no_instances tests/test_asg.py::AutoScalingTest::test_asg_tag_and_propagate tests/test_asg.py::AutoScalingTest::test_asg_third_ami_filter tests/test_asg.py::AutoScalingTest::test_asg_vpc_filter tests/test_asg.py::AutoScalingTest::test_valid_asg_with_launch_templates
c7n/resources/asg.py
c7n/resources/asg.py