diff --git a/CHANGELOG.md b/CHANGELOG.md
index b188730..a12be4c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
 
 `mae` follows [Semantic Versioning](http://semver.org/).
 
+## [1.0.7] - 2019-02-28
+### Fixed
+- 🐞 Fixed a bug ([#1](https://github.com/paambaati/mae/issues/1)) where an app without labels can cause an empty response.
+
 ## [1.0.6] - 2018-12-31
 ### Added
 - Tests for CLI.
diff --git a/mae/__init__.py b/mae/__init__.py
index d2c89c9..a89ccfb 100644
--- a/mae/__init__.py
+++ b/mae/__init__.py
@@ -1,5 +1,5 @@
-__name__ = 'mae'
-__version__ = '1.0.6'
+__name__ = 'Mesos-App-Exporter'
+__version__ = '1.0.7'
 __author__ = 'GP'
 __maintainer__ = 'GP'
 __email__ = 'me@httgp.com'
diff --git a/mae/mae.py b/mae/mae.py
index 8626e9f..a333b5b 100644
--- a/mae/mae.py
+++ b/mae/mae.py
@@ -45,7 +45,7 @@ class MesosAppExporter:
 
         app_metrics_endpoints = list()
         for index, task in enumerate(tasks):
-            labels = task.get('labels').get('labels')
+            labels = task.get('labels', {}).get('labels', {})
             label_dict = dict()
             for label in labels:
                 label_dict.update({label.get('key'): label.get('value')})

An app without any labels can crash mae's response
When the app definition does not have any labels, the response is empty. This can fixed by adding defaults to the `get()` calls here —

https://github.com/paambaati/mae/blob/ab1eadba7bec0c47199827dfae5bfa57a6ac94b1/mae/mae.py#L48
diff --git a/tests/fixtures/task_data_4.json b/tests/fixtures/task_data_4.json
new file mode 100644
index 0000000..0e5bd6c
--- /dev/null
+++ b/tests/fixtures/task_data_4.json
@@ -0,0 +1,99 @@
+{
+	"get_tasks": {
+		"launched_tasks": [
+			{
+				"task_id": {
+					"value": "production.labelless-app.36dec447-0567-11e9-a0d5-12164c467f0e"
+				},
+				"name": "production.labelless-app",
+				"statuses": [
+					{
+						"executor_id": {
+							"value": "production.labelless-app.36dec447-0567-11e9-a0d5-12164c467f0e"
+						},
+						"uuid": "nPcAC+mhSnKooebv+6SnfA==",
+						"task_id": {
+							"value": "production.labelless-app.36dec447-0567-11e9-a0d5-12164c467f0e"
+						},
+						"healthy": true,
+						"timestamp": 1545427722.56431,
+						"container_status": {
+							"executor_pid": 7277,
+							"network_infos": [
+								{
+									"ip_addresses": [
+										{
+											"ip_address": "10.181.9.9"
+										}
+									]
+								}
+							]
+						},
+						"source": "SOURCE_EXECUTOR",
+						"state": "TASK_RUNNING",
+						"agent_id": {
+							"value": "d59f7ce8-7b0a-48e1-a71d-81ddad9cfa8c-S461"
+						}
+					}
+				],
+				"status_update_state": "TASK_RUNNING",
+				"status_update_uuid": "nPcAC+mhSnKooebv+6SnfA==",
+				"framework_id": {
+					"value": "545b613d-52cc-4f5f-922c-4dacc444e544-0000"
+				},
+				"state": "TASK_RUNNING",
+				"agent_id": {
+					"value": "d59f7ce8-7b0a-48e1-a71d-81ddad9cfa8c-S461"
+				},
+				"resources": [
+					{
+						"type": "SCALAR",
+						"scalar": {
+							"value": 2.0
+						},
+						"role": "*",
+						"name": "cpus"
+					},
+					{
+						"type": "SCALAR",
+						"scalar": {
+							"value": 14000.0
+						},
+						"role": "*",
+						"name": "mem"
+					},
+					{
+						"ranges": {
+							"range": [
+								{
+									"begin": 31064,
+									"end": 31065
+								}
+							]
+						},
+						"type": "RANGES",
+						"role": "*",
+						"name": "ports"
+					}
+				],
+				"discovery": {
+					"name": "production.labelless-app",
+					"visibility": "FRAMEWORK",
+					"ports": {
+						"ports": [
+							{
+								"protocol": "tcp",
+								"number": 31064
+							},
+							{
+								"protocol": "tcp",
+								"number": 31065
+							}
+						]
+					}
+				}
+			}
+		]
+	},
+	"type": "GET_TASKS"
+}
\ No newline at end of file
diff --git a/tests/test_mae.py b/tests/test_mae.py
index f421c40..e8a34c0 100644
--- a/tests/test_mae.py
+++ b/tests/test_mae.py
@@ -71,6 +71,14 @@ class TestMesosAppExporter(unittest.TestCase):
         endpoints = self.exporter.get_app_metrics_endpoints(task_data)
         self.assertEqual(len(endpoints), 0)
 
+    def test_mae_get_endpoint_4_no_labels(self):
+        """
+        Test if task data without any labels do not throw any errors.
+        """
+        task_data = self.__readJsonFile('fixtures/task_data_4.json')
+        endpoints = self.exporter.get_app_metrics_endpoints(task_data)
+        self.assertEqual(len(endpoints), 0)
+
     @patch('requests.get')
     def test_get_metrics_1_single_app(self, mock_request):
         """

pip install -e .
parse_log_pytest
requirements.txt
pytest
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
certifi==2021.5.30
chardet==3.0.4
idna==2.8
importlib-metadata==4.8.3
iniconfig==1.1.1
-e git+https://github.com/paambaati/mae.git@ab1eadba7bec0c47199827dfae5bfa57a6ac94b1#egg=mae
mock==2.0.0
packaging==21.3
pbr==6.1.1
pluggy==1.0.0
py==1.11.0
pyparsing==3.1.4
pytest==7.0.1
requests==2.21.0
six==1.12.0
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.24.3
zipp==3.6.0

name: mae
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
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - 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=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - chardet==3.0.4
      - idna==2.8
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - mock==2.0.0
      - packaging==21.3
      - pbr==6.1.1
      - pluggy==1.0.0
      - py==1.11.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - requests==2.21.0
      - six==1.12.0
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.24.3
      - zipp==3.6.0
prefix: /opt/conda/envs/mae

tests/test_mae.py::TestMesosAppExporter::test_mae_get_endpoint_4_no_labels
tests/test_mae.py::TestMesosAppExporter::test_get_metrics_1_single_app tests/test_mae.py::TestMesosAppExporter::test_get_metrics_2_multiple_apps tests/test_mae.py::TestMesosAppExporter::test_mae_get_endpoint_1_single_task tests/test_mae.py::TestMesosAppExporter::test_mae_get_endpoint_2_multiple_tasks tests/test_mae.py::TestMesosAppExporter::test_mae_get_endpoint_3_no_matching_tasks
mae/mae.py mae/__init__.py CHANGELOG.md
mae/mae.py mae/__init__.py CHANGELOG.md