Repository: spring-cloud/spring-cloud-dataflow
Issue: NPE when registering the app without the app resolution schema

As a user, I copied the following app registration command from the [Microsite](https://dataflow.spring.io/docs/recipes/polyglot/processor/), but it failed with an NPE.

register:
```
app register --type processor --name python-processor --uri springcloud/polyglot-python-processor:0.1
```

error:
```
2019-06-04 22:03:20.278 ERROR 1 --- [nio-8080-exec-9] o.s.c.d.s.c.RestControllerAdvice         : Caught exception while handling a request                                   │
│                                                                                                                                                                              │
│ java.lang.NullPointerException: null                                                                                                                                         │
│     at org.springframework.cloud.dataflow.registry.support.AppResourceCommon.getResource(AppResourceCommon.java:154)                                                         │
│     at org.springframework.cloud.dataflow.registry.service.DefaultAppRegistryService.getResourceVersion(DefaultAppRegistryService.java:266)
```

1) We need to add `docker:` schema in the microsite instructions
2) Handle the NPE gracefully

Changed files:
spring-cloud-dataflow-registry/src/test/java/org/springframework/cloud/dataflow/registry/support/AppResourceCommonTests.java
spring-cloud-dataflow-registry/src/main/java/org/springframework/cloud/dataflow/registry/support/AppResourceCommon.java

diff --git a/spring-cloud-dataflow-registry/src/main/java/org/springframework/cloud/dataflow/registry/support/AppResourceCommon.java b/spring-cloud-dataflow-registry/src/main/java/org/springframework/cloud/dataflow/registry/support/AppResourceCommon.java
index 4c5cc44ea..85a42e2ff 100644
--- a/spring-cloud-dataflow-registry/src/main/java/org/springframework/cloud/dataflow/registry/support/AppResourceCommon.java
+++ b/spring-cloud-dataflow-registry/src/main/java/org/springframework/cloud/dataflow/registry/support/AppResourceCommon.java
@@ -151,7 +151,12 @@ public class AppResourceCommon {
 	public Resource getResource(String resourceUri) {
 		Assert.isTrue(StringUtils.hasText(resourceUri), "Resource URI must not be empty");
 		try {
-			String scheme = new URI(resourceUri).getScheme().toLowerCase();
+			String scheme = new URI(resourceUri).getScheme();
+			if (scheme == null) {
+				throw new IllegalArgumentException("Invalid URI schema for resource: " + resourceUri
+						+ " Expected URI schema prefix like file://, http:// or classpath:// but got none");
+			}
+			scheme = scheme.toLowerCase();
 			Assert.notNull(scheme, "a scheme (prefix) is required");
 
 			switch (scheme) {
diff --git a/spring-cloud-dataflow-registry/src/test/java/org/springframework/cloud/dataflow/registry/support/AppResourceCommonTests.java b/spring-cloud-dataflow-registry/src/test/java/org/springframework/cloud/dataflow/registry/support/AppResourceCommonTests.java
index c1d8e565f..6d4e87412 100644
--- a/spring-cloud-dataflow-registry/src/test/java/org/springframework/cloud/dataflow/registry/support/AppResourceCommonTests.java
+++ b/spring-cloud-dataflow-registry/src/test/java/org/springframework/cloud/dataflow/registry/support/AppResourceCommonTests.java
@@ -70,6 +70,19 @@ public class AppResourceCommonTests {
 		}
 	}
 
+	@Test
+	public void testInvalidUriSchema() {
+		try {
+			appResourceCommon.getResource("springcloud/polyglot-python-processor:0.1");
+			fail("Excepted IllegalArgumentException for an invalid URI schema prefix");
+		}
+		catch (IllegalArgumentException iae) {
+			assertThat(iae.getMessage().equals("Invalid URI schema for resource: " +
+					"springcloud/polyglot-python-processor:0.1 Expected URI schema prefix like file://, " +
+					"http:// or classpath:// but got none"));
+		}
+	}
+
 	@Test
 	public void testDefaultResource() {
 		String classpathUri = "classpath:AppRegistryTests-importAll.properties";