Fix NPE when receiving a NDEF message of 0 length.

Change-Id: I44661f453f7819b7847bb892f868cb05bdd66aaa
diff --git a/src/com/android/apps/tag/TagViewer.java b/src/com/android/apps/tag/TagViewer.java
index 92ff03b..7b7f5ca 100644
--- a/src/com/android/apps/tag/TagViewer.java
+++ b/src/com/android/apps/tag/TagViewer.java
@@ -179,7 +179,7 @@
             // that time we read it from the database and view it.
             Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
             NdefMessage[] msgs;
-            if (rawMsgs != null) {
+            if (rawMsgs != null && rawMsgs.length > 0) {
                 // stupid java, need to cast one-by-one
                 msgs = new NdefMessage[rawMsgs.length];
                 for (int i=0; i<rawMsgs.length; i++) {